Repository navigation
fix(ci): give the WebAssembly gate a measured budget, shared links and its own build cache - #1334
Merged
Merged
Conversation
…d its own build cache The gate compiles and vets the whole tree for both wasm targets, 7-11 minutes on a hosted runner, under go test's default ten-minute timeout, so a slow run died with "test timed out after 10m0s" in whatever test was running. make wasm-check now sets WASM_GATE_TIMEOUT (25m, about twice the cold run) and the job's limit sits above it. Each command is linked once per run and shared by TestWasmBuilds, TestWasmRuns and the browser REPL walkthrough, every link is a timed subtest, and the GitHub Actions gate restores its own Go build and module cache, saved on each develop push by wasm-cache.yml, instead of setup-go's shared entry, which another job saved without the wasm objects. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Contributor
Author
|
WebAssembly gate durations on GitHub Actions,
The run on this branch is still a cold compile — pull-request caches are private to their branch, so the first |
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The GitHub Actions job "WebAssembly gate" (
tests/wasm) finishes in 7-11 minutes on every pull-request head, undergo test's default-timeout 10m, so a run that lands on a slow hosted runner dies withpanic: test timed out after 10m0sin whichever test is running — three unrelated heads failed that way on 2026-10-20/21, none on an assertion. The same gate is green on CircleCI, whose config already passes-timeout 30m.Where the time goes, from the
-voutput of the last twenty GitHub runs (one representative 574 s run; the slowest passing run took 600 s of package time, the failing ones were killed at 600 s duringTestWasmRuns):TestWasmBuilds/wasip1/tree_compiles(GOOS=wasip1 go build ./...)TestWasmBuilds/wasip1/tree_vets(GOOS=wasip1 go vet ./...)TestWasmBuilds/js/tree_compilesTestWasmBuilds/js/tree_vetsTestWasmRuns/wasip1(relinked all 7 commands, then ran them)TestWasmRuns/js(relinked all 7, ran them, gzip budgets)TestBrowserREPLWalkthroughs(-tags sysml_rejs build, walkthroughs, gzip budget)TestRunnerDeadlineand the dependency/parity testsSo 440 of the 574 s were compiling and vetting the two trees — work the Go build cache would absorb, except that every run of this job was cold:
setup-go'scache: trueentry is keyed ongo.sumalone and shared by every Go job, and the job that finishes first saves it, so the entry never held the wasm objects (Cache hit occurred on the primary key …, not saving cachein every wasm-gate log). The gzip steps are small (5-10 s together). The duplicated linking cost about 17 s per run.Changes:
make wasm-checknow runsgo testwith-timeout $(WASM_GATE_TIMEOUT), 25 m by default: about twice the cold 7-11 minute run, and the Makefile comment says so. The GitHub job callsmake wasm-checkrather than its owngo testline, so there is one budget, and the job'stimeout-minutesrises from 20 to 30 so a timeout isgo test's, which names the running test, not the runner's.linknow builds a given target, command and tag set once per run (async.Onceper key, under a directoryTestMainowns and removes) and returns the same binary to every test that asks; a test asking after a failed link gets the same failure report.TestWasmBuilds,TestWasmRunsandTestBrowserREPLWalkthroughsshare the binaries, so the seven relinks per target inTestWasmRunsand the standalone-tags sysml_rebuild are gone. Run alone (-run TestWasmRuns), the run gate still links what it needs.TestWasmRuns/<target>/links the commandsandTestWasmBuilds/js/links sysml -tags sysml_reare new subtests;linklogs each link's duration. A future timeout therefore names the step.setup-go's cache off and restores~/.cache/go-buildand~/go/pkg/modfrom awasm-gate-<os>-go<version>-<go.sum hash>-<sha>key by prefix, nearest first. Pull-request caches are private to their branch, so a new workflow,wasm-cache.yml, runs the samemake wasm-checkon every push todevelopthat touches Go sources and saves the cache it leaves behind (also after a red gate: the objects are as good). Each develop push saves one entry and the older ones age out under the repository's cache quota.No assertion was dropped or weakened and both targets still build, vet, link and run.
In-flight overlap
Checked the 21 open pull requests and the 43 remote branches without a pull request (
git ls-remote --heads origin, each diffed againstorigin/develop) for changes undertests/wasm/, to thewasm-gatejob in.github/workflows/pr.yml, or to the Makefile: none touch the gate. #1324 editspr.ymlonly to rename the MDK plugin job.How it was verified
go build ./...,go vet ./...,gofmt -l .(empty),make lint(staticcheck + gosec),python3 scripts/changelog.py check.make wasm-checkwith the new settings, warm cache: 118.9 s for the package;TestWasmRuns/<target>/links the commandsandlinks sysml -tags sysml_rereport 0.00 s becauseTestWasmBuildslinked the binaries first.go test -run 'TestWasmRuns|TestBrowserREPLWalkthroughs'alone: 67 s, with the links then done insideTestWasmRuns(thelinked cmd/… in …log lines).GOCACHE: 290.6 s for the package (TestWasmBuilds205 s), 102.6 s warm.Checklist
make lintpasses locally; the suite touched (make wasm-check) passes with the new settings, the rest ofmake testruns in CIchanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/cf14ed1555b240a3be47852cfa6e3f80
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/cf14ed1555b240a3be47852cfa6e3f80?variant=devin
Requested by: @HuiJun