forked from Azure/iotedge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix race between tests that try to bind to a port.
The original code would create a TcpListener and throw it away, which meant that multiple calls to `get_unused_port` could end up with the same port. Also, enable all the edgelet-docker tests that had been disabled on Windows due to the original issue (even though it was not a Windows-specific problem). However this means that the number of tests in the edgelet-docker crate running at the same time is much higher, so it's more likely for the tests to hit the issue described in rust-lang/backtrace-rs#230 (comment) Specifically, any test that panics at the same time as another test is using `failure` to collect a backtrace has a chance of crashing the entire test binary with STATUS_HEAP_CORRUPTION on Windows, if the `RUST_BACKTRACE` env var is set. To avoid this, I've modified the tests that use `#[should_panic]` + `Result::unwrap` to assert that an operation must fail to instead use `Result::unwrap_err`.
- Loading branch information
Showing
10 changed files
with
163 additions
and
225 deletions.
There are no files selected for viewing
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
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
Oops, something went wrong.