Skip to content

Split cli.test.js into focused suites; de-flake Task-pool CLI test - #1153

Merged
lvcabral merged 1 commit into
masterfrom
test/split-cli-tests-fix-task-pool-flake
Aug 5, 2026
Merged

Split cli.test.js into focused suites; de-flake Task-pool CLI test#1153
lvcabral merged 1 commit into
masterfrom
test/split-cli-tests-fix-task-pool-flake

Conversation

@lvcabral

@lvcabral lvcabral commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Splits test/cli/cli.test.js (2000+ lines covering core CLI flags, SceneGraph runtime behavior, .bpk encryption, and ECP endpoints) into four focused files: cli.test.js (core), cli-scenegraph.test.js, cli-bpk.test.js, and cli-ecp.test.js.
  • Factors shared exec/zipFolder/decryptBpk/ECP-polling helpers (previously duplicated between the two ECP describe blocks) into a new cli-test-utils.js.
  • Fixes the intermittently-flaky "Delivers a field set from one Task thread to another Task's thread" test: task-pool-app's render-thread polling loop only budgeted 5s for the whole multi-hop Task chain, and the dispatch Task's own rendezvous wait was capped at 5s too — tight under CI's parallel child-process load, so it occasionally starved for CPU rather than actually hanging. Widened those budgets and moved the test to sequential scheduling with a retry, matching the existing timer-hop-app precedent in the same file, so a genuine regression still fails deterministically.
  • Updates the handful of .claude/CLAUDE.md / .claude/docs/*.md / probe README references that pointed at specific tests by their old cli.test.js location.

Test plan

  • npx vitest run test/cli — all 7 files pass (94 tests + 1 todo, same count as before the split)
  • npx vitest run (full repo suite) — 203 files, 2540 tests pass
  • Ran the previously-flaky task-pool test standalone 5x in a row to confirm stability
  • npm run lint and npx prettier --check on the touched files

🤖 Generated with Claude Code

…ol test

cli.test.js had grown to 2000+ lines covering unrelated concerns (core CLI
flags, SceneGraph runtime behavior, .bpk encryption, ECP endpoints), making
it hard to navigate and slow to scan for a single failure. Split it into
cli.test.js (core), cli-scenegraph.test.js, cli-bpk.test.js, and
cli-ecp.test.js, with shared exec/zip/ECP helpers factored into
cli-test-utils.js to remove duplication between the two ECP suites.

Also fixed "Delivers a field set from one Task thread to another Task's
thread", which flaked intermittently: task-pool-app's render-thread polling
loop only budgeted 5s for the whole multi-hop Task chain (and the dispatch
Task's own rendezvous wait was capped at 5s too), which is tight under CI's
parallel child-process load and occasionally starved for CPU rather than
actually hanging. Widened those budgets and, matching the file's existing
timer-hop-app precedent, moved the test to sequential scheduling with a
retry so a genuine regression still fails deterministically.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

@lvcabral
lvcabral merged commit 0b77eef into master Aug 5, 2026
3 checks passed
@lvcabral
lvcabral deleted the test/split-cli-tests-fix-task-pool-flake branch August 5, 2026 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant