Repository navigation
perf(test): fake TUI auth child timers - #126563
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Land-ready proof for reviewed head This is a bounded, maintainer-requested test-performance change only. The TUI Commands and results:
Controlled same-machine A/B, one worker, separate caches, one discarded warmup,
Production LOC: +0/-0. Tests: +14/-6. Documentation, changelog, screenshots, Latest ClawSweeper state: acknowledgement only; no substantive review and no |
|
Merged via squash.
|
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
The TUI auth-child unit suite spends more than two seconds waiting for real
one-second cancellation timers, slowing every selected maintainer and CI test
run without improving its process-lifecycle coverage.
Why This Change Was Made
This maintainer-requested, AI-assisted test-performance change selectively fakes
only
setTimeoutandclearTimeoutin the two timing-sensitive unit tests. Itpreserves all four existing tests and strengthens the escalation boundary: no
SIGKILLat 999 ms, exactly oneSIGKILLat 1,000 ms, and no escalation through1,001 ms after the child exits. The separate real PTY sibling continues to cover
actual child-process behavior; production code and product behavior are unchanged.
User Impact
There is no user-visible behavior change. Developers and CI get faster,
deterministic TUI auth-child unit tests while real-process integration coverage
remains independently intact.
Evidence
tbx_01m0ewexxkdy1pnsbkj6tbw94v, with one worker,distinct caches, import diagnostics,
/usr/bin/time -v, one excluded warmup,and two retained runs per side:
https://github.com/openclaw/openclaw/actions/runs/32338236379
4.27 s (mean 4.115 s): 1.965 s faster, a 32.3% improvement.
tbx_01m0ex1ah2jsk3vz3bp93rhpb1:https://github.com/openclaw/openclaw/actions/runs/32338929522
node scripts/run-vitest.mjs src/tui/tui-auth-child.test.tsnot a fake process lifecycle.
node scripts/run-vitest.mjs run --config test/vitest/vitest.tui-pty.config.ts src/tui/tui-auth-child-pty.e2e.test.tsnode scripts/check-changed.mjs -- src/tui/tui-auth-child.test.tsSIGKILLcall assertion; the approved patch was restored afterward.git diff --check: clean.changes test execution only. No agent transcript is included.