@@ -59,7 +59,8 @@ public async Task Execute()
59
59
// Use `sdk` image to build and run test app
60
60
string buildTag = BuildTestAppImage ( "build" , solutionDir , customBuildArgs ) ;
61
61
tags . Add ( buildTag ) ;
62
- await RunTestAppImage ( buildTag , command : $ "dotnet run") ;
62
+ string dotnetRunArgs = _isWeb || _imageData . Version . Major < 8 ? $ " --urls http://0.0.0.0:{ _imageData . DefaultPort } " : string . Empty ;
63
+ await RunTestAppImage ( buildTag , command : $ "dotnet run{ dotnetRunArgs } ") ;
63
64
}
64
65
65
66
// Running a scenario of unit testing within the sdk container is identical between a console app and web app,
@@ -74,7 +75,7 @@ public async Task Execute()
74
75
// Use `sdk` image to publish FX dependent app and run with `runtime` or `aspnet` image
75
76
string fxDepTag = BuildTestAppImage ( "fx_dependent_app" , solutionDir , customBuildArgs ) ;
76
77
tags . Add ( fxDepTag ) ;
77
- // if we're a webapp on windows
78
+ // If we're a web app on Windows, use the ContainerAdministrator account
78
79
string fxDepUser = ( _isWeb && ! DockerHelper . IsLinuxContainerModeEnabled ) ? _adminUser : null ;
79
80
await RunTestAppImage ( fxDepTag , user : fxDepUser ) ;
80
81
@@ -106,7 +107,7 @@ public async Task Execute()
106
107
}
107
108
finally
108
109
{
109
- // tags.ForEach(tag => _dockerHelper.DeleteImage(tag));
110
+ tags . ForEach ( tag => _dockerHelper . DeleteImage ( tag ) ) ;
110
111
Directory . Delete ( solutionDir , true ) ;
111
112
}
112
113
}
@@ -310,8 +311,6 @@ private void CreateProjectWithSdkImage(string templateName, string destinationPa
310
311
_dockerHelper . Copy ( $ "{ containerName } :{ ProjectContainerDir } ", destinationPath ) ;
311
312
}
312
313
313
- // pass in user instead of boolean for runAsAdmin
314
- // pass admin by default, can pass in app as a special case for testing non-root
315
314
private async Task RunTestAppImage ( string image , string user = null , string command = null )
316
315
{
317
316
string containerName = _imageData . GetIdentifier ( "app-run" ) ;
@@ -339,7 +338,7 @@ private async Task RunTestAppImage(string image, string user = null, string comm
339
338
340
339
public static async Task < HttpResponseMessage > GetHttpResponseFromContainerAsync ( string containerName , DockerHelper dockerHelper , ITestOutputHelper outputHelper , int containerPort , string pathAndQuery = null , Action < HttpResponseMessage > validateCallback = null , AuthenticationHeaderValue authorizationHeader = null )
341
340
{
342
- int retries = 4 ;
341
+ int retries = 30 ;
343
342
344
343
// Can't use localhost when running inside containers or Windows.
345
344
string url = ! Config . IsRunningInContainer && DockerHelper . IsLinuxContainerModeEnabled
0 commit comments