-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add retry for AddressInUseException during aspnetcore tests #96
Comments
Can we override the port specified in launchSettings.json at startup? |
Yeah we can e.g. set |
Interesting. What about a hill climbing wait and make the test app wait until the port is free again? Given that the number of ports is limited this might be needed anyway. I don't know how many ports are opened in total by aspnetcore scenario tests. |
I don't think that'd work since I've seen at least one failure where we hit a port that is used by some system service so that one would never be free.
Right now we only run a handful of tests so we could also define our own pool of port numbers in a safe range and let tests grab from there while not reusing ports. I'm just not sure we should override this as it might impact the validity of the scenario tests. |
We're seeing occasional test failures in the VMR:
All of them are a variation of the below, due to the port being already used:
We should add some sort of retry.
Note that the way the templates work is that
dotnet new
generates a random port and writes it into Properties/launchSettings.json so just rerunning the app will hit the same port, we'd presumably need to delete and recreate the project./cc @ViktorHofer @mthalman
The text was updated successfully, but these errors were encountered: