File tree Expand file tree Collapse file tree
profiler/test/Datadog.Profiler.IntegrationTests/Helpers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -153,8 +153,10 @@ private string GetApplicationPath()
153153 }
154154
155155 // Use port 0 so Kestrel binds an OS-assigned free port and avoids the TOCTOU race
156- // of pre-picking a port. The actual bound URL is parsed from stdout after the run.
157- var arguments = $ "--timeout { TestDurationInSeconds } --urls http://localhost:0";
156+ // of pre-picking a port. Bind to 127.0.0.1 explicitly: Kestrel rejects "localhost:0"
157+ // with InvalidOperationException ("Dynamic port binding is not supported when binding
158+ // to localhost"). The actual bound URL is parsed from stdout after the run.
159+ var arguments = $ "--timeout { TestDurationInSeconds } --urls http://127.0.0.1:0";
158160 if ( ! string . IsNullOrEmpty ( _commandLine ) )
159161 {
160162 arguments += $ " { _commandLine } ";
You can’t perform that action at this time.
0 commit comments