Repository navigation
perf(tests): reuse persistent worker-thread Node broker across JS asset suites - #336
Merged
Merged
Conversation
…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).
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
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.
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.
Summary
worker_threadsNode broker (tests/_node_runner.py,tests/_node_worker.js,tests/_node_thread.js) packaged inMANIFEST.inso 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.process.exit,process.exitCode,require('process')shim, throwinguncaughtException/unhandledRejectionexit codes 1 and 7, virtual files, and dead-broker/mismatched-ID fast-fail recovery) and validate asset cache entries via filestat.tests/test_galaxy_gravity_floor.py,tests/test_galaxy_gravity_slider.py,tests/test_galaxy_gravity_slider_no_dead_zone.py, andtests/test_graph_engine_asset.pyonto the broker, and add 12 dedicated regression tests intests/test_node_runner_broker.py.Independent Verification (
4a60679c58db8ccb88578f41be155e74f92410e1)ruff check .: PASSpython scripts/check_commercial_manifest.py: PASSpython scripts/externalize_dashboard_assets.py: PASSpyright --pythonpath .venv\Scripts\python.exe: PASS (0 errors, 0 warnings, 0 informations)pytest -o addopts= tests/ -q -rs -n 2 --dist loadfile):10774 passed, 106 skipped(exit 0)eval.harnesssample/codemem,eval.ablation,eval.reinforcement,eval.adversarial_memory_security,eval.grounded,eval.code_arm,eval.spec_crawl,eval.evidence_contracts): PASSdeepseek/deepseek-v4.1-flash --effort max): 2/2 APPROVE (0Blockers,0Majors). Non-overlapping with#332and#333. Ready for operator review and merge gate.