ci(docker): the smoke test runs beside the image build, in one job instead of two #2219

Merged
jaylouisw merged 1 commit from ci/1119-2229 into main 2026-11-19 23:08:10 +00:00
Owner

What was slow

Server smoke test and Docker build were two jobs that never overlapped. This runner gives a run four slots: the three test legs hold three of them for ~60 s, and the fourth carries Classify the change (12-16 s) -> Server smoke test (10 s) -> Docker build (20 s) end to end. Each of the two also paid its own 5.3 s checkout of the same commit.

Evidence, /api/v1/repos/jaylouisw/packetforge/actions/tasks over the last 60 pull-request runs (7607-7974):

  • the Docker build task is created a median 2 s after the Server smoke test task has finished (p10 -1 s, p90 +3 s), so the two never overlapped in a single one of those runs;
  • in 24 of the 60 runs the build was still running after every test leg had reported: median 11 s past them, 97 s at worst. Run 7913: legs done at +69 s, Docker build at +115 s, arm at +119 s.
  • baseline run 7974 (pull #2218): smoke task 21092 22:25:32.9 -> 22:25:41.7 (10 s), docker task 21093 22:25:44.9 -> 22:26:03.7 (20 s), last test leg task 21088 done 22:26:05.0, arm task 21094 22:26:08.7 -> 22:26:11.6.

The change

One job (key docker, display name Server smoke and Docker build) that runs both checks: one checkout, one container, and scripts/smoke-http.js detached beside the image build instead of in front of it. smoke-http.js listens on 127.0.0.1:0 and keeps its state under os.tmpdir(), so it shares the tree with the build without touching it.

Coverage unchanged

Same scripts/smoke-http.js and the same 180 s bound (status recorded to a file and reported by an if: always() step, 200 s bound on the wait, 124/137 still named as a stop); same eight Dockerfile static checks; same docker build -t packetforge:ci-run-<run> with its 180 s bound; same prune under if: always(); same ::error title=Server smoke test / Docker build titles; either red still reddens the job. node scripts/run-tests.js locally: 390 suites, 13082 assertions, 0 failed, the same counts as the last green CI legs (run 7974). check-ci-disk-hygiene.js, check-canonical-urls.js, check-node-surface.js and test/ci-disk-hygiene.test.js pass.

After

Job count per run 7 -> 6, one 5.3 s checkout gone, and the smoke verdict now arrives with the build instead of 11 s before it. This PR's own run id is in the comments once it finishes.

## What was slow `Server smoke test` and `Docker build` were two jobs that never overlapped. This runner gives a run four slots: the three test legs hold three of them for ~60 s, and the fourth carries `Classify the change` (12-16 s) -> `Server smoke test` (10 s) -> `Docker build` (20 s) end to end. Each of the two also paid its own 5.3 s checkout of the same commit. Evidence, `/api/v1/repos/jaylouisw/packetforge/actions/tasks` over the last 60 pull-request runs (7607-7974): - the `Docker build` task is **created a median 2 s after the `Server smoke test` task has finished** (p10 -1 s, p90 +3 s), so the two never overlapped in a single one of those runs; - in **24 of the 60 runs the build was still running after every test leg had reported**: median 11 s past them, 97 s at worst. Run 7913: legs done at +69 s, Docker build at +115 s, arm at +119 s. - baseline run 7974 (pull #2218): smoke task 21092 22:25:32.9 -> 22:25:41.7 (10 s), docker task 21093 22:25:44.9 -> 22:26:03.7 (20 s), last test leg task 21088 done 22:26:05.0, arm task 21094 22:26:08.7 -> 22:26:11.6. ## The change One job (key `docker`, display name `Server smoke and Docker build`) that runs both checks: one checkout, one container, and `scripts/smoke-http.js` detached beside the image build instead of in front of it. `smoke-http.js` listens on `127.0.0.1:0` and keeps its state under `os.tmpdir()`, so it shares the tree with the build without touching it. ## Coverage unchanged Same `scripts/smoke-http.js` and the same 180 s bound (status recorded to a file and reported by an `if: always()` step, 200 s bound on the wait, 124/137 still named as a stop); same eight Dockerfile static checks; same `docker build -t packetforge:ci-run-<run>` with its 180 s bound; same prune under `if: always()`; same `::error title=Server smoke test` / `Docker build` titles; either red still reddens the job. `node scripts/run-tests.js` locally: 390 suites, 13082 assertions, 0 failed, the same counts as the last green CI legs (run 7974). `check-ci-disk-hygiene.js`, `check-canonical-urls.js`, `check-node-surface.js` and `test/ci-disk-hygiene.test.js` pass. ## After Job count per run 7 -> 6, one 5.3 s checkout gone, and the smoke verdict now arrives with the build instead of 11 s before it. This PR's own run id is in the comments once it finishes.
ci(docker): the smoke test runs beside the image build, in one job instead of two
All checks were successful
CI / Classify the change (pull_request) Successful in 9s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 11s
CI / Server smoke and Docker build (pull_request) Successful in 22s
CI / Test (Node 18) (pull_request) Successful in 56s
CI / Test (Node 20) (pull_request) Successful in 54s
CI / Test (Node 22) (pull_request) Successful in 55s
CI / Arm auto-merge (pull_request) Successful in 4s
49e6992006
Server smoke test and Docker build were separate jobs and, on this runner,
never overlapped: three slots are held by the test legs for ~60 s and the
fourth carried Classify the change, then the smoke test, then the build, one
after another. Measured over the last 60 pull-request runs (7607-7974): the
Docker build task was created a median 2 s after the smoke task had finished
(p10 -1 s, p90 +3 s), and in 24 of the 60 the build outlived every test leg -
median 11 s past them, 97 s at worst (run 7913: legs at +69 s, build at +115 s).
Each job also paid its own 5.3 s checkout of the same commit.

Both checks need the same tree and container and neither reads anything the
other writes (smoke-http.js listens on 127.0.0.1:0 and keeps its state in
os.tmpdir()), so they are one job now: one checkout, one container, and the
~10 s HTTP smoke runs over the ~20 s image build.

Nothing is skipped or weakened: same script, same 180 s bound, same eight
Dockerfile static checks, same docker build and its 180 s bound, same prune
under if: always(), same ::error titles for both checks, and either failure
still reddens the job. The smoke verdict is printed at the end of the job
beside the build's, the same move the test legs made for their static checks.
Job key stays `docker` (test/ci-disk-hygiene.test.js pins it); the status
context becomes 'CI / Server smoke and Docker build'.
forgejo-actions scheduled this pull request to auto merge when all checks succeed 2026-11-19 22:42:12 +00:00
Author
Owner

After: run 7989 (this PR), one job instead of two.

Pushed as 49e69920. The workflow parsed and ran; the merged job is Server smoke and Docker build (task 21129), and every check it carried ran:

22:41:39  task received
22:41:46  checked out 49e6992 ... (5.3 s, one checkout for both checks)
22:41:47  starting node scripts/smoke-http.js here, so the image build below runs over it
22:41:47  Dockerfile static checks (8) passed
22:41:51  docker daemon found - building the image for real
22:41:59  Successfully built 8b24e02c996e
22:42:00  --- what this job left on the host ---   (image rm + builder prune, if: always())
22:42:00  ok ... 18 assertions ... HTTP smoke passed (all checks clean)   [printed by the report step]
22:42:00  Job succeeded
before (run 7974) after (run 7989)
jobs per run (ci.yml) 7 6
fourth-slot time for the two checks 29.5 s (smoke 10 s + docker 19.5 s) + a 3.2 s dispatch hop = 32.7 s 21.8 s in one task
checkouts of the same commit 2 (10.8 s) 1 (5.3 s)
smoke and image build never overlap (docker task created a median 2 s after smoke ended, 60-run sample) overlapped: smoke started 22:41:47, build 22:41:51-59

Run total 72 s in 7989 against 68 s in 7974: the test legs are the wall clock in both (legs 54-56 s in 7989, 57-61 s in 7974, and they started staggered at +4/+8/+10 this time against +0/+1/+2), so this change pays out in slot time and in the tail, not in the median. On the 24 of the last 60 runs where the second job outlived every leg (median 11 s, 97 s at worst) that tail is now ~10 s shorter, and it can no longer be two dispatches deep.

Coverage identical: 390 suites / 13082 assertions in each leg (same as 7974), the same 18 smoke assertions, the same 8 Dockerfile checks, the same real docker build and the same prune. Nothing skipped, nothing retried.

**After: run 7989 (this PR), one job instead of two.** Pushed as 49e69920. The workflow parsed and ran; the merged job is `Server smoke and Docker build` (task 21129), and every check it carried ran: ``` 22:41:39 task received 22:41:46 checked out 49e6992 ... (5.3 s, one checkout for both checks) 22:41:47 starting node scripts/smoke-http.js here, so the image build below runs over it 22:41:47 Dockerfile static checks (8) passed 22:41:51 docker daemon found - building the image for real 22:41:59 Successfully built 8b24e02c996e 22:42:00 --- what this job left on the host --- (image rm + builder prune, if: always()) 22:42:00 ok ... 18 assertions ... HTTP smoke passed (all checks clean) [printed by the report step] 22:42:00 Job succeeded ``` | | before (run 7974) | after (run 7989) | |---|---|---| | jobs per run (ci.yml) | 7 | 6 | | fourth-slot time for the two checks | 29.5 s (smoke 10 s + docker 19.5 s) + a 3.2 s dispatch hop = 32.7 s | 21.8 s in one task | | checkouts of the same commit | 2 (10.8 s) | 1 (5.3 s) | | smoke and image build | never overlap (docker task created a median 2 s *after* smoke ended, 60-run sample) | overlapped: smoke started 22:41:47, build 22:41:51-59 | Run total 72 s in 7989 against 68 s in 7974: the test legs are the wall clock in both (legs 54-56 s in 7989, 57-61 s in 7974, and they started staggered at +4/+8/+10 this time against +0/+1/+2), so this change pays out in slot time and in the tail, not in the median. On the 24 of the last 60 runs where the second job outlived every leg (median 11 s, 97 s at worst) that tail is now ~10 s shorter, and it can no longer be two dispatches deep. Coverage identical: 390 suites / 13082 assertions in each leg (same as 7974), the same 18 smoke assertions, the same 8 Dockerfile checks, the same real `docker build` and the same prune. Nothing skipped, nothing retried.
jaylouisw deleted branch ci/1119-2229 2026-11-19 23:08:11 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!2219
No description provided.