Skip to content

test: stop CI test runs from timing out - #346

Merged
gnidan merged 1 commit into
mainfrom
ci-test-flakes
Oct 6, 2026
Merged

gnidan merged 1 commit into
mainfrom
ci-test-flakes

Conversation

@gnidan

@gnidan gnidan commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

run-tests has been failing now and then with Error: [vitest-worker]: Timeout calling "onTaskUpdate" even though every test passes. Both causes are in the bugc example tests (packages/bugc/test/examples/examples.test.ts).

The timeout. The compiler and the hyperjump validator do all of their work synchronously, and vitest moves from one test to the next with promises only. So that whole file ran from start to end without the worker's event loop ever turning. The worker sends progress reports to the main process, but it cannot read the replies until the loop turns, and birpc gives up after 60 s. On CI the file takes about 64 s, so it was just over that line. Locally I measured the longest gap between event loop turns in that file at 15.0 s, which is the whole file. A file of seven 9 s busy tests reproduces the same error locally, and an afterEach that waits on setImmediate makes it go away. The examples file now has that afterEach, which brings the longest gap down to 0.66 s (the slowest single test).

The slow validation. The "Program validity" tests from #328 validated each whole program. A program lists all the variables in scope at every instruction, so intermediate/arrays.bug comes out at about 1.5 MB, and hyperjump took 1.5 s per program locally and 7 to 9 s on CI, against the 10 s limit. The schema was not being recompiled; a second validation of the same program takes just as long. But the contexts repeat: that program has 829 instructions and only 130 distinct contexts, and they repeat across optimization levels too. Each instruction's context is a plain $ref to ethdebug/format/program/context, so the test now validates the program with the instruction contexts left out, and validates each distinct context once against the context schema (cached across tests). Errors are still reported at #/instructions/<n>/context/.... I checked that a bad context and a bad instruction field still fail the test.

Measurements, yarn test --maxWorkers=2 locally:

before after
examples.test.ts 16.2 s 5.8 s
arrays.bug validity, per level 1.6–1.8 s 0.3–0.8 s
longest event loop stall 15.0 s 0.66 s
whole suite 24.6 s 19.6 s

On CI, examples.test.ts went from 63.8 s to 17–25 s, and the slowest arrays.bug validity test from 9.1 s to 2.2–3.2 s (three runs of both Node jobs on this branch, all green).

The bugc example tests never let the worker's event loop turn, so on a
slow runner vitest timed out waiting on its own progress reports. Yield
after each test, and validate each distinct instruction context once
instead of re-validating every copy.
@gnidan gnidan added the changelog: skip This PR changes schemas/ or a published package without a changelog entry on purpose label Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-06 14:16 UTC

@gnidan
gnidan merged commit 205c434 into main Oct 6, 2026
18 checks passed
@gnidan
gnidan deleted the ci-test-flakes branch October 6, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: skip This PR changes schemas/ or a published package without a changelog entry on purpose

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant