Skip to content

chore(ci): stop concurrent runs sharing the integration test tenant - #457

Open
anachili wants to merge 1 commit into
masterfrom
chi.heng/serialise-integration-test-tenant
Open

anachili wants to merge 1 commit into
masterfrom
chi.heng/serialise-integration-test-tenant

Conversation

@anachili

@anachili anachili commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

The integration tests under cli/tests/ drive one real tenant, shared by every run in the repository. Several commands under test list or prune everything in it, so one run's fixture teardown can break another run's command — and the failure lands on a test that has nothing to do with the code being changed.

That is what took out the v0.43.0 publish (run 37785697074): test_prune_dry_run_backs_up_without_deleting failed with

Could not list datasets to check for shared sources
API request failed with 404 Not Found: No such source `15d6572774abeb4d'.

Another run deleted a source while its dataset still referenced it, and the platform's dataset listing then 404s for the whole tenant. re prune has to list every dataset to check for shared sources, so it inherits that. The tag was already published, the binaries were not, and the release had to be re-run by hand.

A release triggers this every time. Publishing fires the Publish workflow seconds after the merge is pushed to master, and both workflows run the suite on ubuntu and macos — four legs on one tenant. The v0.43.0 windows overlapped exactly:

Run Trigger Window
37785652025 Build merge pushed 13:36:14 → 13:41
37785697074 Publish release published 13:36:34 → 13:46 ✗
37786253872 Build push 13:40:44 → 13:45

v0.42.0 got lucky.

What changed

  • The leg that runs the suite takes a repository-wide concurrency group, integration-test-tenant, shared by both workflows, with cancel-in-progress: false. The suite can no longer overlap itself.
  • The other legs get a group of their own (keyed on github.run_id) so they are never queued behind it.
  • Those legs run unit and doc tests only, via SKIP_INTEGRATION_TESTS=1. The suite exercises the CLI against the API over HTTP, which is identical work on either OS; the per-OS build and unit tests still run everywhere, so portability coverage is unchanged.
  • scripts/check runs everything by default, so nothing changes for anyone running it locally.

One group rather than one per OS, because a cross-OS pair races just as happily as a same-OS one. The group is on the job and not the workflow because GitHub keeps only a single pending run per group and cancels any earlier one — with every matrix leg in the group, legs would be cancelled rather than queued.

Test plan

  • SKIP_INTEGRATION_TESTS=1 ./scripts/check with REINFER_CLI_TEST_{PROJECT,TOKEN,ENDPOINT} unset: passes, 54 + 41 unit tests, no tenant needed. --lib --bins selects only the two unit-test binaries, where --all-targets picks up three including the live suite.
  • Both workflow files parse, and neither group expression contains a newline — a folded scalar would have put one inside the ${{ }}.
  • SKIP_INTEGRATION_TESTS is written ${{ matrix.os != 'ubuntu-24.04' && '1' || '0' }} rather than the other way round on purpose: GitHub casts the string '0' to a falsy number, so cond && '0' || '1' yields '1' on both branches and would have skipped the suite everywhere.
  • This PR's own ubuntu leg running the suite, and its macos leg skipping it, is the real check.

Not fixed here

Two runs still cannot safely share the tenant — they are only kept from doing so. Proper isolation means a tenant per run, which needs infrastructure rather than a workflow change. Separately, the platform returning 404 for an entire dataset listing because one dataset references a deleted source looks worth a ticket of its own.

The integration tests under `cli/tests/` drive one real tenant, shared by
every run in the repository, and several commands list or prune everything
in it. So one run's fixture teardown breaks another run's command: deleting
a source while its dataset still references it makes the platform's dataset
listing return `404 No such source` for the whole tenant, failing an
unrelated test.

A release triggers this every time, because publishing it fires the Publish
workflow seconds after its merge is pushed to master, and both workflows run
the suite on two OSes — four legs on one tenant. It took out the v0.43.0
publish, which had to be re-run by hand.

Give the leg that runs the suite a repository-wide concurrency group, shared
by both workflows, so the suite never overlaps itself. The other legs get a
group of their own so they are not queued behind it, and run unit and doc
tests only: the suite exercises the CLI against the API over HTTP, which is
the same work on either OS.

`scripts/check` keeps running everything by default, so this does not change
what it does for anyone running it locally.

This branch has not been deployed

No deployments
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