Tabstack

Fix flaky upload testWorking~/wt/upload-flake
~/wt/upload-flakefix/upload-flake
❯cargo test upload
running 9 teststest upload::resumes_after_drop ... FAILEDthread 'resumes_after_drop' panicked: timed out after 2000 mstest result: FAILED. 8 passed; 1 failed
exit 1016.24 s

This test fails about one run in five. Find out why and fix it.

The test waits a fixed 2 s for the retry, but the retry timer starts only after the socket closes, which can take longer on a busy machine. I'll wait on the retry event instead of the clock.

~/wt/upload-flakefix/upload-flake
❯rg -n "sleep\(" tests/upload.rs
42:    sleep(Duration::from_millis(2000)).await;
exit 038 ms

Editing tests/upload.rs

← Tabstack