Skip to content

Fix flaky firmware cancel test - #37

Merged
joshk merged 1 commit into
mainfrom
fix/firmware-cancel-test-timing
Nov 24, 2026
Merged

joshk merged 1 commit into
mainfrom
fix/firmware-cancel-test-timing

Conversation

@joshk

@joshk joshk commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

TestSignFirmwareCancelledRemovesTempFiles sometimes failed with "cancelling took 4.2s" when the machine was busy, for example when running the race tests for all packages.

The test allowed 3 seconds from the start of signing. That time included starting the fwup stub, which took up to 3.1 seconds under load. Signing itself always returned about 500ms after the cancel, which is the WaitDelay. So the code was fine, and the test was timing the wrong thing.

The test now times only from the cancel to signing returning. The stub's child process now sleeps 30 seconds instead of 5, so a missing WaitDelay still fails clearly. The test kills that child when it ends. It also waits up to 20 seconds for fwup to start, up from 5.

I checked that the test still fails without WaitDelay: signing then takes 30 seconds to return.

🤖 Generated with Claude Code

TestSignFirmwareCancelledRemovesTempFiles allowed 3s from the start of
signing. Under load, starting the fwup stub alone took up to 3.1s, while
signing always returned about 500ms (WaitDelay) after the cancel. So the
test failed on busy machines without anything being wrong.

It now times only from the cancel to signing returning. The stub's child
sleeps 30s instead of 5s, so waiting on it still fails clearly, and it is
killed when the test ends. The poll for fwup starting waits up to 20s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joshk
joshk merged commit 0364673 into main Nov 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant