-
Notifications
You must be signed in to change notification settings - Fork 11
Parallelize test execution to reduce runtime #2511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: plengauer <[email protected]>
Co-authored-by: plengauer <[email protected]>
Co-authored-by: plengauer <[email protected]>
plengauer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot this changeset to the run_tests script is too big. make only minimal changes and dont use fancy things like bash arrays, they are scary. i suggest just creating background jobs and waiting for them and making sure all these jobs use separate files to do their stuff. i suggest taking the original loop and transforming the body into a subshell started in background and we wait at the end. we can "buffer" the output to the main script with the perl trick
Co-authored-by: plengauer <[email protected]>
Co-authored-by: plengauer <[email protected]>
Co-authored-by: plengauer <[email protected]>
Simplified the implementation per your feedback. Changes made in commits bf3ad48, 12b7d4a, and e1af25a:
The approach is now minimal: just background the test execution, use perl for buffering, and wait at the end. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR parallelizes test execution in run_tests.sh to significantly reduce CI/test cycle duration. Tests previously ran sequentially; now they execute concurrently while maintaining clean output and proper failure tracking.
Key changes:
- Background job execution with process substitution for parallel test runs
- Perl-based output buffering to prevent interleaved console output
- Temporary flag file mechanism to track and propagate test failures
- Port conflict resolution between
test_auto_netcat.sh(port 12345) andtest_auto_injection_netcat.sh(now port 12346)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/run_tests.sh | Implements parallel test execution with background jobs, output buffering via perl, and failure tracking using a temporary flag file |
| tests/auto/test_auto_injection_netcat.sh | Changes hardcoded port from 12345 to 12346 to prevent conflicts with test_auto_netcat.sh when tests run concurrently |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
plengauer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot there are tests failing, pls fix
Co-authored-by: plengauer <[email protected]>
Head branch was pushed to by a user without write access
|
@copilot there is an error in the test run, please solve: https://github.com/plengauer/Thoth/actions/runs/19771228924/job/56658212272 |
…re connect Co-authored-by: plengauer <[email protected]>
Head branch was pushed to by a user without write access
Fixed in 4bf343b. The test_auto_netcat.sh TEST 0 was failing due to a race condition - the client was connecting before the listening server was ready. Added a 1-second sleep between starting the server and connecting. |
|
@copilot also kindly fix this error: https://github.com/plengauer/Thoth/actions/runs/19771228924/job/56658212314 |
Co-authored-by: plengauer <[email protected]>
Fixed in 76500d8. Added perl output buffering ( |
test_auto_netcat.shuses ports 12345, 12346, 12347, 12348, 12349 (incrementing)test_auto_injection_netcat.shuses port 12355 (to avoid overlap with netcat)test_auto_background_job.shuses port 8080test_auto_injection_node.shuses port 8081 (to avoid overlap with background_job)perl -e '$| = 1; print while <>;') to ensure test output is flushed immediately and not interleavedOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.