Repository navigation
fix(tests): deflake qa-lab process-group pid-file waits - #126351
Merged
Merged
Conversation
The model catalog abort test waited for pid-file existence, but the catalog child's writeFileSync exposes an open-truncate window: the test could read the file empty and fail on a NaN pid assertion (CI run 32231699569, checks-node-changed-extensions-config-37). Add a qa-lab-local process-wait test helper that waits for the asserted state (a parseable pid) with generous 10s deadlines and self-diagnosing timeout errors, and consolidate the two hand-rolled helper copies in model-catalog.runtime.test.ts and test-file-scenario-command-lifecycle.test.ts onto it. Also retire the stale 1.7s abort-settle ceiling (calibrated against a removed 1.5s in-plugin kill grace) in favor of a 5s bound with the contract documented.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
August 19, 2026 16:08
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 20, 2026
) The model catalog abort test waited for pid-file existence, but the catalog child's writeFileSync exposes an open-truncate window: the test could read the file empty and fail on a NaN pid assertion (CI run 32231699569, checks-node-changed-extensions-config-37). Add a qa-lab-local process-wait test helper that waits for the asserted state (a parseable pid) with generous 10s deadlines and self-diagnosing timeout errors, and consolidate the two hand-rolled helper copies in model-catalog.runtime.test.ts and test-file-scenario-command-lifecycle.test.ts onto it. Also retire the stale 1.7s abort-settle ceiling (calibrated against a removed 1.5s in-plugin kill grace) in favor of a 5s bound with the contract documented.
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 Problem This Solves
Fixes a flaky CI failure where the qa-lab test "kills aborted catalog process groups when the catalog child exits first" intermittently failed on loaded runners (run 32231699569, job
checks-node-changed-extensions-config-37, 2026-08-19) with aNumber.isInteger(descendantPid)assertion on aNaNpid.Why This Change Was Made
The failure signature (NaN assertion rather than a wait timeout) shows the pid file existed but read back empty: the catalog child's
writeFileSyncexposes an open-truncate window, so an existence-basedwaitForFilecan win between the child's open and write and parse""intoNaN. The 2s wait ceilings were additionally flaky-by-construction for spawning a real node CLI plus a grandchild under CI load. The same hazards were hand-rolled twice in qa-lab (model-catalog.runtime.test.tsandtest-file-scenario-command-lifecycle.test.ts); core'stest/helpers/process-wait.tsalready documents and solves this bug class but is not importable across the extension boundary.This change adds a qa-lab-local
process-wait.test-helper.ts(waits on the asserted state — a parseable pid — with generous 10s deadlines and self-diagnosing timeout errors) and consolidates both test files onto it. It also retires the stale< 1_700msabort-settle ceiling, which was calibrated against a 1.5s in-plugin kill grace deleted when the runtime moved torunCommandWithTimeout(300ms tree grace); the new 5s bound still proves abort settles with the exiting descendants rather than a long fixed kill ceiling.User Impact
None at runtime — test-only change. CI stops flaking on this suite; future timeouts self-diagnose ("file missing" vs. the unparsable content last seen) instead of failing on an opaque NaN assertion.
Evidence
node scripts/run-vitest.mjs extensions/qa-lab/src/model-catalog.runtime.test.ts extensions/qa-lab/src/test-file-scenario-command-lifecycle.test.ts— 2 files, 12/12 tests passed.pnpm tsgo:extensions:test,scripts/run-oxlint.mjson touched files,git diff --check— all clean.