Skip to content

fix(ci): make the workspace tests deterministic on the CI runner - #21

Open
richmont wants to merge 1 commit into
mainfrom
fix/ci-flaky-tests
Open

richmont wants to merge 1 commit into
mainfrom
fix/ci-flaky-tests

Conversation

@richmont

Copy link
Copy Markdown
Contributor

Closes #20

Summary

Makes cargo test --locked --workspace deterministic on the GitHub runner. The Workspace validation workflow has failed on most runs since the tests started running again on 2026-11-23; the issue has the full history and per-test evidence.

  • Runtime-use test (external_use_sees_a_real_linux_runtime_and_returns_to_idle). The private copy of /bin/sleep was named approved-runtime. On some ubuntu-26.04 runners /bin/sleep is the uutils multicall binary, which picks the utility from the file name, so the copy printed coreutils: unknown program 'approved-runtime' and exited immediately. The copy now keeps the name sleep in its own temporary folder.
  • Discovery suggestions (application fix). The worker popped a candidate and marked its title in flight in a later critical section, so a concurrent refresh could queue the same title again, and a title with no result was searched twice. The pop now claims the title in the same critical section and skips candidates already searched or whose title already has an answer. This also removes duplicate search requests in the app.
  • Tests that read asynchronous writes. The stored credential after sign-in, the chosen game's cover download, and an in-memory match that the edit's own inference and refresh overwrite are written after the snapshot the tests waited for. The tests now wait for the write, with the same 45 s limit as the existing helpers.

Verification

  • cargo test --locked --workspace --no-fail-fast: all pass.
  • cargo clippy --locked --workspace --all-targets -- -D warnings: clean.
  • cargo xwin check --workspace --all-targets --target x86_64-pc-windows-msvc --locked: passes (only pre-existing warnings).
  • The gamenode-app suite passed 6 of 6 times as two concurrent copies on a 12-core host.
  • Not reproduced locally: the uutils case (the local host uses GNU coreutils). That fix follows the CI log message.

Out of scope

Some tests are slow even alone (local_evidence_enrichment_overrides_retries_and_account_switching takes about 14 s against a 45 s limit) and time out with six concurrent suite copies. They have not failed in CI since 2026-11-13; replacing their real waits with controlled time is tracked in #20.

The Workspace validation run has failed on most pushes since
2026-11-16, always in `cargo test --workspace`:

- The real-runtime check copied /bin/sleep as `approved-runtime`. On
  ubuntu-26.04 /bin/sleep is the uutils multicall binary, which picks
  the utility from the file name, so the copy printed
  "coreutils: unknown program 'approved-runtime'" and exited at once.
  The private copy now keeps the name `sleep`.
- Discovery suggestions could search one title twice. The worker popped
  a candidate and marked its title in flight in a later critical
  section, so a concurrent refresh queued the same title again; a
  candidate whose search found nothing was then searched again. The pop
  now claims the title in the same critical section and skips
  candidates already searched or whose title already has an answer.
- Three tests read state that is written after the snapshot they waited
  for: the stored credential after sign-in, the chosen game's cover
  download, and an in-memory match that the edit's own inference and
  refresh overwrite. They now wait for the write.

cargo test --workspace, clippy -D warnings and cargo xwin check pass;
the app suite passed six times as two concurrent copies.
@richmont richmont added the bug Something isn't working label Nov 25, 2026
@richmont richmont linked an issue Nov 25, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 545c18fd-d7ca-452d-bdb6-1cd7a0504670
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: testes do workspace falham de forma intermitente no CI

1 participant