@@ -59,7 +59,8 @@ public async Task Execute()
5959 // Use `sdk` image to build and run test app
6060 string buildTag = BuildTestAppImage ( "build" , solutionDir , customBuildArgs ) ;
6161 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 } ") ;
6364 }
6465
6566 // 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()
7475 // Use `sdk` image to publish FX dependent app and run with `runtime` or `aspnet` image
7576 string fxDepTag = BuildTestAppImage ( "fx_dependent_app" , solutionDir , customBuildArgs ) ;
7677 tags . Add ( fxDepTag ) ;
77- // if we're a webapp on windows
78+ // If we're a web app on Windows, use the ContainerAdministrator account
7879 string fxDepUser = ( _isWeb && ! DockerHelper . IsLinuxContainerModeEnabled ) ? _adminUser : null ;
7980 await RunTestAppImage ( fxDepTag , user : fxDepUser ) ;
8081
@@ -106,7 +107,7 @@ public async Task Execute()
106107 }
107108 finally
108109 {
109- // tags.ForEach(tag => _dockerHelper.DeleteImage(tag));
110+ tags . ForEach ( tag => _dockerHelper . DeleteImage ( tag ) ) ;
110111 Directory . Delete ( solutionDir , true ) ;
111112 }
112113 }
@@ -310,8 +311,6 @@ private void CreateProjectWithSdkImage(string templateName, string destinationPa
310311 _dockerHelper . Copy ( $ "{ containerName } :{ ProjectContainerDir } ", destinationPath ) ;
311312 }
312313
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
315314 private async Task RunTestAppImage ( string image , string user = null , string command = null )
316315 {
317316 string containerName = _imageData . GetIdentifier ( "app-run" ) ;
@@ -339,7 +338,7 @@ private async Task RunTestAppImage(string image, string user = null, string comm
339338
340339 public static async Task < HttpResponseMessage > GetHttpResponseFromContainerAsync ( string containerName , DockerHelper dockerHelper , ITestOutputHelper outputHelper , int containerPort , string pathAndQuery = null , Action < HttpResponseMessage > validateCallback = null , AuthenticationHeaderValue authorizationHeader = null )
341340 {
342- int retries = 4 ;
341+ int retries = 30 ;
343342
344343 // Can't use localhost when running inside containers or Windows.
345344 string url = ! Config . IsRunningInContainer && DockerHelper . IsLinuxContainerModeEnabled
0 commit comments