Uh oh!
There was an error while loading. Please reload this page.
perf: run cloud tests and recordings in parallel - #982
Conversation
Both mock.sh and record.sh now run each cloud's tests/recordings concurrently as background jobs instead of sequentially. Results are aggregated after all clouds finish. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: CHANGES REQUESTED
Findings
- [HIGH] test/mock.sh — Major test regression: Parallelizing cloud tests causes pass rate to drop from 270/436 to 119/436 (failures increase from 165 to 316). The subshell isolation of
TEST_DIR,MOCK_LOG, and counter variables appears incomplete — agent scripts spawned within parallel subshells likely encounter race conditions or environment mismatches when resolving mock paths, leading to widespread assertion failures. The parallelization pattern itself is structurally correct (subshells, isolated temp dirs, count file aggregation), but the interaction withrun_script_with_timeoutand the mock environment is broken in practice. - [MEDIUM] test/record.sh —
record_cloudcallsprompt_credentialswhich uses interactiveread -r, but in parallel subshells stdout/stderr are redirected to log files and stdin is inherited from the parent. IfPROMPT_FOR_CREDS=true(the default forallmode), the parallelreadcalls will race for stdin, producing undefined behavior. This is a functional issue rather than security, but worth noting.
No Security Issues
The changes themselves have no security vulnerabilities:
- No command injection vectors (all variables are internally sourced)
- No credential leaks (env var handling unchanged)
- No unsafe eval/source patterns
- Temp file creation and cleanup is properly handled
- macOS bash 3.x compatible
Tests
- bash -n: PASS (both files)
- Mock tests: FAIL (119 passed vs 270 on main — significant regression)
- curl|bash pattern: N/A (test-only files)
- macOS compat: OK
Recommendation
The approach is sound but the implementation needs debugging. The parallel subshell isolation is not working correctly with the existing mock infrastructure, causing most tests to fail. Please verify the mock test pass rate matches or exceeds the sequential baseline (270 passed) before merging.
-- security/pr-reviewer
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Findings
- [MEDIUM] test/record.sh:1058-1067 — Background subshells break interactive credential prompting (
prompt_credentialsreads stdin, but background processes have no stdin). Thebash test/record.sh allmode with missing credentials will silently skip clouds rather than prompting. Not a security issue, but a functional regression for the interactiveallflow. - [MEDIUM] test/mock.sh:793-794, test/record.sh:1071-1073 —
wait "$pid" 2>/dev/null || trueswallows subshell exit codes. If a cloud subshell crashes before writing its.countsfile, the failure is silently ignored (0 passed, 0 failed counted for that cloud). This could mask test failures. - [LOW] test/record.sh:1055 —
RECORD_RESULTS_DIR=$(mktemp -d)has no cleanup trap for unexpected script exit (only explicitrm -rfat line 1092). Temp files with API responses could linger if the script is killed. Minor since the data would be in /tmp anyway.
Tests
- bash -n: PASS (both test/mock.sh and test/record.sh)
- bun test: N/A (no .ts files changed)
- curl|bash pattern: N/A (test scripts, not agent scripts)
- macOS compat: OK (uses printf, $((var + 1)), mktemp -d, no echo -e or source <())
Notes
- Mock test results identical to main branch (270 passed, 165 failed, 1 skipped) — no regressions introduced
- Parallelization logic is clean: each cloud gets isolated temp dir, isolated MOCK_LOG, isolated counters
- No command injection, credential leaks, or path traversal risks
- All temp directories properly cleaned up under normal execution
-- security/pr-reviewer
Uh oh!
There was an error while loading. Please reload this page.
AhmedTMM
commented
Feb 13, 2026
Review ResponseRe: mock.sh regression claim — The reviewer's claim of a regression from 270/436 to 119/436 is incorrect. Running Re: record.sh stdin race — This was a valid concern. Fixed in 67d6efc: credential prompting ( |
Summary
test/mock.shnow runs each cloud's mock tests concurrently as background jobstest/record.shnow records each cloud's API fixtures concurrentlyContext
Extracted from #833 as a smaller, focused PR.
Test plan
bash -n test/mock.shpassesbash -n test/record.shpassesbash test/mock.shruns successfully with same pass/fail counts as sequential🤖 Generated with Claude Code