Skip to content

api: fix two racey tests in the UI API test suite - #255

Merged
MiloCasagrande merged 1 commit into
mainfrom
fix/api-test
Sep 2, 2026
Merged

api: fix two racey tests in the UI API test suite#255
MiloCasagrande merged 1 commit into
mainfrom
fix/api-test

Conversation

@MiloCasagrande

Copy link
Copy Markdown
Member

TestApiRolloutDaemon started the watchdog daemon before calling
CreateRollout, so the daemon's 20ms tick could commit the rollout
before the pre-commit assertions ran. Move daemons.Start() to after
those assertions.

TestApiUpdateTail used exact equality to assert the body of an SSE
stream that also receives keepalives every 50ms. A third keepalive
could accumulate between requireBody returning (after 2 keepalives)
and d1.ProcessEvents firing, making the subsequent exact-equality
check unsatisfiable. Replace with strings.Contains so the check is
immune to the number of leading keepalives.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
Signed-off-by: Milo Casagrande mcasagra@qti.qualcomm.com

TestApiRolloutDaemon started the watchdog daemon before calling
CreateRollout, so the daemon's 20ms tick could commit the rollout
before the pre-commit assertions ran. Move daemons.Start() to after
those assertions.

TestApiUpdateTail used exact equality to assert the body of an SSE
stream that also receives keepalives every 50ms. A third keepalive
could accumulate between requireBody returning (after 2 keepalives)
and d1.ProcessEvents firing, making the subsequent exact-equality
check unsatisfiable. Replace with strings.Contains so the check is
immune to the number of leading keepalives.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Milo Casagrande <mcasagra@qti.qualcomm.com>
@MiloCasagrande

Copy link
Copy Markdown
Member Author

I keep hitting this issue when tests are run here: I let Claude debug and fix it based on the logs from Github run.

@MiloCasagrande
MiloCasagrande merged commit 1db152a into main Sep 2, 2026
15 checks passed
@MiloCasagrande
MiloCasagrande deleted the fix/api-test branch September 2, 2026 14:30
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.

2 participants