-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[smoke tests] when getting "random" ports, use the filesystem to avoi…
…d conflicts between parallel test cases (processes) (#5421) ### Description This should eliminate an entire class of smoke test flakiness in CICD due to conflicting ports. Doing lsof on flaky tests in CICD, we observe that a new parallel test takes a port from a currently running node between the time it is stopped and started. When a node N goes down (by design, in the test) a port that was being used by that node N is stolen by a node M in another test. When node N restarts, the conflict occurs. (It seems very hard to hit if things were really random, yet in practice we see this at least once a day. Possibly the OS is prioritizing recently released ephemeral ports.) cargo nextest runs parallel tests in different processes, so we need to avoid conflicts between processes. This introduces a counter file that keeps track of the last port used and a file for locking this to avoid races. ### Test Plan Run smoke tests in CICD. Also run `cargo test` locally as a sanity check that the behavior is not changed for non-nextest uses.
- Loading branch information
Showing
3 changed files
with
172 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters