You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 19, 2018. It is now read-only.
// If the hint contains a specific port, return it unchanged.
32
60
returnuriHint;
33
61
}
34
62
}
35
63
}
36
64
37
65
// Copied from https://github.com/aspnet/KestrelHttpServer/blob/47f1db20e063c2da75d9d89653fad4eafe24446c/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/AddressRegistrationTests.cs#L508
66
+
//
67
+
// This method is an attempt to safely get a free port from the OS. Most of the time,
68
+
// when binding to dynamic port "0" the OS increments the assigned port, so it's safe
69
+
// to re-use the assigned port in another process. However, occasionally the OS will reuse
70
+
// a recently assigned port instead of incrementing, which causes flaky tests with AddressInUse
71
+
// exceptions. This method should only be used when the application itself cannot use
72
+
// dynamic port "0" (e.g. IISExpress). Most functional tests using raw Kestrel
73
+
// (with status messages enabled) should directly bind to dynamic port "0" and scrape
74
+
// the assigned port from the status message, which should be 100% reliable since the port
0 commit comments