-
Notifications
You must be signed in to change notification settings - Fork 45
Description
On the last merge to main we had an intermittent test failure. The test passed on a manually triggered re-run.
@vados-cosmonic it seems like this is due to getRandomPort not waiting for the temporary server it creates to be closed before reporting the port.
However, I think there's a fundamental race condition here: either we have the race seen in this test failure, or we have a potential race between this and another test, where that other test might steal the port between the temporary server shutting down and our test server starting up.
That second one is probably less likely, but I'm not sure. A way to avoid either would be to not create a temporary server at all: why not create the actual test server in the global script instead of the test function, and return its port once it got created?