Repository navigation
test: make release integration tests deterministic - #325
Merged
Merged
Conversation
nixuuu
added a commit
that referenced
this pull request
Nov 7, 2026
ssh2's ed25519 key generation drops a leading zero byte of the public key about once in 256 keys (83 of 20,000) and writes a private key that neither ssh2 nor OpenSSH can read (`Malformed OpenSSH private key`). The gateway uses it for each owner's SSH install key, so an affected owner's SSH worker installs fail until the key is rotated. A generated pair that doesn't parse is now generated again (`apps/gateway/src/core/ssh-keys.ts`); 0 of 20,000 bad afterwards. Owners who already have a bad stored key still need to rotate it once. Split out of the release flake PR (#325), where the SSH installer test's own host key hit the same bug. Copy audit: no UI text changed. Fixes: #5
spawn_thread answers once the side thread is stored; the gateway delivers its createThread command to the worker afterwards. Five assertions read the scripted worker's created list right after the tool result and failed on a slow runner (Expected: 4, Received: undefined). ScriptedWorker.createdThread waits for that command.
The old gateway's 250 ms queue tick could claim the turn whose lease the test expired before the competitor ticked. The old gateway then ran the held model again and the turn never settled (10 s timeout, last message 'take over'). The old gateway now drains like one handing over: it keeps its running turn and claims nothing.
After enrollment the installer runs 'npm prefix -g'. The test ran the runner's real npm, which cold-starts Node: 0.3-4.1 s on CI and over the 5 s test timeout once. A stub in $HOME/.local/bin, which the installer searches before the system paths, keeps the host toolchain out of the test.
The announcement test left B's withdrawn loopback address in A's routes. Loopback still reaches B there, so the takeover test's dial could succeed through it; B's next advertisement then withdrew it and the stale 127.0.0.1 route came first (lastSuccessMs exactly one hour old). The announcement test now waits for the withdrawal and removes the route.
The test waited for the plugin only. A skill record is applied as waiting until its version's content is fetched, one blob at a time, so B could list the skill without its artifact (Expected: aeb81c…, Received: undefined). The wait now covers the document, the skill version and the plugin artifact.
A watch snapshot reads items before steers. When the provider's user message item is ingested between the two reads, the snapshot shows the steer delivered without the item (Expected: true, Received: false; 2 of 15 runs on one CPU). The test now waits for a snapshot with both.
A test that closes a scripted worker's link can do so while a command is on its way. The worker loop then replied on the closed link, the ConnectError escaped as an unhandled rejection and failed whichever test was running ('offline pools retry the same occurrence', 92 ms). Closing a link right after createThread reproduced it in 10 of 20 runs; the loop now ends quietly on an unavailable link.
The test's SSH server key came from ssh2's ed25519 keygen, which writes an unreadable key for one key in 256; the whole file then failed at startup (Cannot parse privateKey: Malformed OpenSSH private key).
nixuuu
force-pushed
the
test/release-flakes
branch
from
November 7, 2026 09:41
13dcf8d to
e5bbcc9
Compare
This was referenced Nov 13, 2026
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.
Scheduled Release runs on dev were cancelled when one flaky integration test failed in a test shard. This PR collects every test failure from the Release runs and PR CI runs of 2026-11-05 to 2026-11-07, finds the cause of each, and fixes it deterministically. It adds no retries, skips, global timeout increases or workflow changes.
Evidence was collected locally: gateway suites ran one file at a time, mostly pinned to one CPU (
taskset -c 3). Where a race could not be forced naturally, a temporary delay was injected at the racing point, and the same test was run with and without the fix. No injected delay is committed.Fixed here
worker-ssh-command› fixed SSH stdin … preserves the gateway and TLS pin (nightly 42352444980)npm prefix -g. The test ran the runner's real npm, which cold-starts Node: the success path took 0.3–4.1 s on CI (the tampering path, which exits earlier, takes ~10 ms) and once went over the 5 s test timeout ("killed 1 dangling process").npmin$HOME/.local/bin, which the installer searches before the system paths.full-access-mode› an agent's side thread never gets Full access; plusagent-bus› spawn options (PR CI) and the same race in 3 moreagent-bus/agent-bus-crossassertionsspawn_threadanswers once the side thread is stored. The gateway delivers thecreateThreadcommand to the worker afterwards, and the tests readworker.createdright away (Expected: 4, Received: undefined).ScriptedWorker.createdThread(id)waits for that command.createThreadhandling delayed 200 ms: full-access 1 fail → 0; agent-bus 3 relevant fails → 0; agent-bus-cross 2 fails → 0. full-access-mode with 10 reruns on one CPU: 30/30.bots› an expired lease cannot commit an old model answer (PR #318 CI)lan-routes› routes are tried in order of last success (PR CI)127.0.5.2in A's routes. It is the newest route, so A's dial after the dead route succeeded through it (dumped locally). B's next 1 s advertisement then withdrew it, and the stale127.0.0.1route came first. On CIlastSuccessMswas exactly one hour old, the value the test writes.config-sync-environment› a document, a skill and a plugin arrive on B (PR CI)WAITINGuntil its version blob is fetched, one blob at a time (Expected:aeb81c…, Received: undefined).composer-shell› Codex steer executes at delivery (PR CI)core-watch.ts). When the provider's user message item is ingested between the two reads, the steer shows as delivered without its item. The stream sends the event right after, so clients converge; the test only reads the first snapshot.schedules-new-thread› offline pools retry the same occurrence (PR CI)ConnectErrorescaped as an unhandled rejection that failed whichever test was running.createThread, 20 iterations): 10/20 fail → 20/20 pass in 7 consecutive runs. The file with 3 reruns: 21/21.worker-ssh› owner-scoped SSH enrollment trust boundary (PR CI)ssh-keygen -y) can read. The test's server host key failed with "Malformed OpenSSH private key".generateKeyPairSync: 60/20000 and 83/20000 unreadable;ed25519KeyPair: 0/20000. worker-ssh 6/6.Product fix (separate commit
fix(gateway): never store an unreadable ssh install key)The gateway generates each owner's SSH install key with the same ssh2 call (
apps/gateway/src/core/worker-ssh.ts, introduced in #5) and keeps it until rotation. About 1 owner in 256 got a truncated public key and a private key that can never be parsed, so every SSH install failed until they rotated the key.ed25519KeyPairgenerates the pair again when it does not parse. Keys already stored in that state still need Rotate. The commit body carriesFixes: #5. This PR squashes under atest:title, so that link and the patch release only apply if the fix is split out or the PR is retitled.Already fixed by #262 (no change here)
config-sync-execution› an unreachable home fails immediately…: all 6 failures were before fix(runtime): resolve shutdown races blocking nightly releases #262 merged (last one 2026-11-06 09:01; fix(runtime): resolve shutdown races blocking nightly releases #262 merged 10:27), and none since. 8/8 runs on one CPU.remote-threads› a file attached on A… / a file placed in the text on A…: a cascade from the first test (workercreatedread without waiting, thread not settled before the next test held turns). fix(runtime): resolve shutdown races blocking nightly releases #262 fixed exactly that, and none have recurred since.computer-relay› Share onward,process-governor,bots-harness› gateway restart: fixed by fix(runtime): resolve shutdown races blocking nightly releases #262, and none have recurred since.Not flakes
Failures from in-progress feature-branch pushes, not on dev: the CLI import suites on
feat/cli-import-*, and the migration list and error-text failures onfeat/linked-shared-config-7.Gates
bun install,bun run gen:check,bun run typecheck,bun run lint,bun run format:check, the web build andbun run check:tmp(1671 pass, 0 fail, 162 skip; nothing left in the temp dir) are all clean.One thing to know: if TMPDIR is inside a Git checkout,
add-projectandlinked-projectsfail locally, because their "folder without Git" fixtures inherit the checkout's origin.check:tmpabove ran with TMPDIR on disk outside any repository.Copy audit: no UI text changed.