test: stop reading the current-builds list in the same breath as the status #46

Merged
mi merged 2 commits from flaky-cancel-test into main 2026-09-10 06:56:34 +02:00
Owner

The cancel test failed now and then because it asserted an ordering the
executor deliberately does not provide. A build reaches its terminal status and
leaves currentBuilds() at two different moments, and between them lie the
status event, the commit status posted to the forge and the artifact copy. The
test waited for the first and asserted the second in the next line, which held
on an idle machine and not under load — reproduced here in one of three
consecutive runs.

The assertion moves into eventually, like the other waits in this test. Both
places now say why the order is what it is: a build gone from currentBuilds()
while its stored result still says RUNNING would read as stuck forever, and the
watcher's worktree pruning borrows that same list to know which worktrees are
still in use.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

The cancel test failed now and then because it asserted an ordering the executor deliberately does not provide. A build reaches its terminal status and leaves currentBuilds() at two different moments, and between them lie the status event, the commit status posted to the forge and the artifact copy. The test waited for the first and asserted the second in the next line, which held on an idle machine and not under load — reproduced here in one of three consecutive runs. The assertion moves into eventually, like the other waits in this test. Both places now say why the order is what it is: a build gone from currentBuilds() while its stored result still says RUNNING would read as stuck forever, and the watcher's worktree pruning borrows that same list to know which worktrees are still in use. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mi added 1 commit 2026-09-10 06:53:42 +02:00
The cancel test failed now and then because it asserted an ordering the
executor deliberately does not provide. A build reaches its terminal status and
leaves currentBuilds() at two different moments, and between them lie the
status event, the commit status posted to the forge and the artifact copy. The
test waited for the first and asserted the second in the next line, which held
on an idle machine and not under load — reproduced here in one of three
consecutive runs.

The assertion moves into eventually, like the other waits in this test. Both
places now say why the order is what it is: a build gone from currentBuilds()
while its stored result still says RUNNING would read as stuck forever, and the
watcher's worktree pruning borrows that same list to know which worktrees are
still in use.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mi added 1 commit 2026-09-10 06:55:46 +02:00
mi merged commit 397d590702 into main 2026-09-10 06:56:34 +02:00
mi deleted branch flaky-cancel-test 2026-09-10 06:56:34 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mi/werkator#46