Open akoeplinger opened 5 months ago
Can we override the port specified in launchSettings.json at startup?
Yeah we can e.g. set ASPNETCORE_URLS=http://localhost:8080
env var to override that, but I'm not sure whether that could hide issues.
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.
What about a hill climbing wait and make the test app wait until the port is free again?
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.
I don't know how many ports are opened in total by aspnetcore scenario tests.
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