-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Sporadic test failures in BPD tests #3309
Comments
It seems really weird that there would still be collisions with the port randomised like that. It's not like any of the tests lasts for very long either, and the server should be killed reliably in the |
I have not yet looked at this thoroughly, so do not believe anything I say! According to this StackOverflow question we can just use port To get that port number from the server process to the main process in order to create the clients, we could use a multiprocessing.Value. Though to write to that |
Wow, that’s very cool! I didn’t know about that Unix feature. It’s at least worth giving it a try! |
The bpd test bind a socket in order to test the protocol implementation. When running concurrently this often resulted in an attempt to bind an already occupied port. By using the port number `0` we instead let the OS choose a free port. We then have to extract it from the socket (which is handled by `bluelet`) via `mock.patch`ing.
…tbox#3330 Add a changelog entry asking plugin developers to report any further occurrences of this failure.
fix "Sporadic test failures in BPD tests #3309"
Travis seems to fail surprisingly often in the BPD tests with this error:
Here's an example job, for instance.
The problem is that these tests, since #3190, use a socket to set up communication between a server and a client. But if two of these run at the same time, then the server runs into an error when trying to listen on that socket. I tried to mitigate this in a hacky way in 99778d9 by randomizing the port over 10,000 options, but failures of this kind are still happening pretty often on Travis.
A potential solution would be to catch this error and re-randomize a few times before giving up.
The text was updated successfully, but these errors were encountered: