Skip to content

Revert flaky-test set-aside (#2987): it broke main's tests - #2990

Merged
davidmckayv merged 1 commit into
mainfrom
ci/revert-flaky-tests-set-aside
Dec 5, 2026
Merged

davidmckayv merged 1 commit into
mainfrom
ci/revert-flaky-tests-set-aside

Conversation

@davidmckayv

Copy link
Copy Markdown
Contributor

Why

Main's CI has failed since #2987 merged, and the merge queue is ejecting other pull requests because of it.

Failures: tests/upstream-upgrade-checks.test.ts rejects the non-literal GH_TOKEN #2987 added to CI's test step; tests shard 1 (an allowlist test) and shard 5 (changed desktop browser tests timing out) fail too.

What changes

A clean revert of #2987. Flaky-test handling comes back in a new PR with these fixed and the full suite run before it merges.

Changelog

none

… tests

Main's CI has failed since #2987 merged (push run 47477429817; merge groups 47477444820 and 47477446193): tests/upstream-upgrade-checks.test.ts rejects the non-literal GH_TOKEN it added to CI's test step, and shards 1 and 5 fail. It returns fixed in a new PR.
@davidmckayv
davidmckayv merged commit 9247b41 into main Dec 5, 2026
4 checks passed
@davidmckayv
davidmckayv deleted the ci/revert-flaky-tests-set-aside branch December 5, 2026 04:23
davidmckayv added a commit that referenced this pull request Dec 5, 2026
davidmckayv added a commit that referenced this pull request Dec 5, 2026
#2987 gave each test step GH_TOKEN, so its runner could read the open flaky-test issues. On main
that broke three things, and #2990 reverted it:

- The test shard's step held a value the upstream upgrade cannot run (scripts/integrate-upstream.ts
  refuses an expression in a step's env).
- The tests inherited the token. scripts/ci-run-tests.test.ts runs ci-run-tests.ts, which then
  asked GitHub through the suite's closed network and timed out at 5 seconds, three times.
- api/client-boundary.test.ts did not know the script's fetch() (fixed in the commit before).

Now each test job reads the list once, in a `uses` step of its own
(.github/actions/flaky-tests-quarantine, `bun scripts/flaky-tests.ts quarantine <file>`), into
flaky-tests-quarantine.json in the runner's temporary folder. The test steps read that file and
never ask GitHub, and hold no token. The upstream upgrade skips `uses` steps, so it runs the shard's
steps as before.

Regression tests: a test step with a token in its environment makes no request to GitHub, and
every ci.yml job that runs tests reads the list first and has no token in a test step. Both fail
on #2987 as it landed, as do the upstream checks and ci-run-tests tests it broke.
timothybrush pushed a commit to timothybrush/OpenBot that referenced this pull request Dec 5, 2026
…are steady, with no token in a test step (CopilotKit#2992)

* Reapply "Set flaky tests aside automatically" (CopilotKit#2987): it broke main's tests (CopilotKit#2990)

This reverts commit 9247b41.

* Name the flaky-tests script's GitHub request in the client boundary allowlist

* Read the tests set aside once per job, so no test step holds a token

CopilotKit#2987 gave each test step GH_TOKEN, so its runner could read the open flaky-test issues. On main
that broke three things, and CopilotKit#2990 reverted it:

- The test shard's step held a value the upstream upgrade cannot run (scripts/integrate-upstream.ts
  refuses an expression in a step's env).
- The tests inherited the token. scripts/ci-run-tests.test.ts runs ci-run-tests.ts, which then
  asked GitHub through the suite's closed network and timed out at 5 seconds, three times.
- api/client-boundary.test.ts did not know the script's fetch() (fixed in the commit before).

Now each test job reads the list once, in a `uses` step of its own
(.github/actions/flaky-tests-quarantine, `bun scripts/flaky-tests.ts quarantine <file>`), into
flaky-tests-quarantine.json in the runner's temporary folder. The test steps read that file and
never ask GitHub, and hold no token. The upstream upgrade skips `uses` steps, so it runs the shard's
steps as before.

Regression tests: a test step with a token in its environment makes no request to GitHub, and
every ci.yml job that runs tests reads the list first and has no token in a test step. Both fail
on CopilotKit#2987 as it landed, as do the upstream checks and ci-run-tests tests it broke.

* Flaky tests sweeps on a timer, reads only the test jobs, within 400 requests

Live in openbot-backend, the sweep ran after every run of CI, End to end and Main images. It listed
the runs of every workflow, and read the annotations of every job of each one, one request at a
time. Its first sweeps ran past their 10 minutes, and spent the requests the repository's token
shares with every other workflow.

Now it:
- runs every 20 minutes, one at a time, from where the last sweep on the timer left off;
- lists only the watched workflows' runs;
- reads only the jobs JOBS names (the ones that run tests), eight at a time;
- never makes more than 400 requests. Past that it keeps the newest runs and says how many older
  ones it left unread.

No `workflow_run` trigger is left, so zizmor's exception for it goes. A test holds JOBS to every
ci.yml job that runs tests, and to no other.
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