Repository navigation
Closed
Labels
Test FlakeTests that work. Wait, no. Actually yes. Hang on. Something is broken.
Description
I saw a test failure of servfail on an unrelated PR (link to build log):
test servfail ... FAILED
Jun 13 14:08:26.294 INFO accepted connection, remote_addr: [::1]:49481, local_addr: [::1]:24284
Jun 13 14:08:26.294 INFO request completed, response_code: 200, uri: /get-records, method: GET, req_id: 3968fa1c-c0df-4dfa-bc09-6ed9404df6c4, remote_addr: [::1]:49481, local_addr: [::1]:24284
Jun 13 14:08:26.295 INFO request completed, response_code: 200, uri: /set-records, method: PUT, req_id: 226d55aa-4ff3-4269-b352-2e9609fd4d50, remote_addr: [::1]:49481, local_addr: [::1]:24284
Jun 13 14:08:26.297 INFO request completed, response_code: 200, uri: /get-records, method: GET, req_id: cf96110c-3b11-437d-be62-845361b459ff, remote_addr: [::1]:49481, local_addr: [::1]:24284
test nxdomain ... ok
Jun 13 14:08:26.299 INFO received request to begin graceful shutdown, local_addr: [::1]:24284
test srv_crud ... ok
failures:
---- servfail stdout ----
Error: error creating server listener: Address already in use (os error 48)
thread 'servfail' panicked at 'assertion failed: `(left == right)`
left: `1`,
right: `0`: the test returned a termination value with a non-zero status code (1) which indicates a failure', /rustc/082e4ca49[770](https://github.com/oxidecomputer/omicron/runs/6862289467?check_suite_focus=true#step:10:771)ebc9cb0ee616f3726a67471be8cb/library/test/src/lib.rs:185:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Rerunning the job succeeded. I glanced briefly at the test, which ultimately uses https://docs.rs/portpicker/latest/portpicker/fn.pick_unused_port.html to pick ports. It looks like that inherently has a TOCTOU issue since it tries to bind the port, closes the socket, and then returns the port number on success - maybe we got unlucky and lost that race?
Metadata
Metadata
Assignees
Labels
Test FlakeTests that work. Wait, no. Actually yes. Hang on. Something is broken.
Activity
davepacheco commentedon Jun 13, 2022
Yeah, that approach to picking an unused port seems broken.
smklein commentedon Jun 20, 2022
I'm writing a DNS client library; I'll patch this in the process
[internal-dns] Avoid 'picking ports' (#1233)