Skip to content

perf(tests): reuse persistent worker-thread Node broker across JS asset suites - #336

Merged
Coding-Dev-Tools merged 3 commits into
mainfrom
perf/node-test-broker
Nov 19, 2026
Merged

Coding-Dev-Tools merged 3 commits into
mainfrom
perf/node-test-broker

Conversation

@Coding-Dev-Tools

Copy link
Copy Markdown
Owner

Summary

  • Add a persistent worker_threads Node broker (tests/_node_runner.py, tests/_node_worker.js, tests/_node_thread.js) packaged in MANIFEST.in so repeated JS asset checks reuse one V8/worker pool instead of spawning fresh Node subprocesses per assertion while keeping per-request global/timer/DOM isolation.
  • Preserve Node exit semantics (process.exit, process.exitCode, require('process') shim, throwing uncaughtException/unhandledRejection exit codes 1 and 7, virtual files, and dead-broker/mismatched-ID fast-fail recovery) and validate asset cache entries via file stat.
  • Migrate tests/test_galaxy_gravity_floor.py, tests/test_galaxy_gravity_slider.py, tests/test_galaxy_gravity_slider_no_dead_zone.py, and tests/test_graph_engine_asset.py onto the broker, and add 12 dedicated regression tests in tests/test_node_runner_broker.py.

Independent Verification (4a60679c58db8ccb88578f41be155e74f92410e1)

  • ruff check .: PASS
  • python scripts/check_commercial_manifest.py: PASS
  • python scripts/externalize_dashboard_assets.py: PASS
  • pyright --pythonpath .venv\Scripts\python.exe: PASS (0 errors, 0 warnings, 0 informations)
  • Full unit suite (pytest -o addopts= tests/ -q -rs -n 2 --dist loadfile): 10774 passed, 106 skipped (exit 0)
  • All 9 offline eval gates (eval.harness sample/codemem, eval.ablation, eval.reinforcement, eval.adversarial_memory_security, eval.grounded, eval.code_arm, eval.spec_crawl, eval.evidence_contracts): PASS
  • Two fresh independent Command Code reviews (deepseek/deepseek-v4.1-flash --effort max): 2/2 APPROVE (0 Blockers, 0 Majors). Non-overlapping with #332 and #333. Ready for operator review and merge gate.

…et suites

Replace per-test Node subprocess spawns in dashboard and extension JS suites
with a persistent worker-thread Node broker that preserves timer drain, error
propagation, and deterministic exit codes (achieving a 4-9% suite speedup and
~25-30% per-call overhead reduction).
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-19T03:11:59.762753Z
We couldn’t complete this review. Comment @codex review to try again.
4a60679 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

…and timeout handling

Close stdout/stderr pipes and join pump threads cleanly in _Worker._stop() (eliminating ResourceWarnings), enqueue an stdout EOF sentinel, preserve broker stderr diagnostics on unexpected exit, guard non-object/interrupted frames, give Node worker timeouts a 1s grace buffer, preserve process.exitCode on bare process.exit(), support 3-arg stream writes, and add regression coverage.
@Coding-Dev-Tools
Coding-Dev-Tools merged commit 245cd48 into main Nov 19, 2026
29 checks passed
@Coding-Dev-Tools
Coding-Dev-Tools deleted the perf/node-test-broker branch November 19, 2026 06:59
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