*: fix test commands racing#4513
Conversation
There was a problem hiding this comment.
Pull request overview
This PR simplifies the “single target” test execution flow across multiple cmd/test* commands to reduce flakiness caused by timeout/close races, and expands internal tests to assert that timeouts still produce per-test results.
Changes:
- Refactors per-target runners to range over a results channel (buffered) and relies on the producer to close it.
- Updates producers to emit timeout failures for any remaining queued tests when
ctxis cancelled. - Extends internal tests to expect full result sets on timeout and adds stress-style timeout tests to prevent regressions.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/testvalidator.go | Refactors validator single-target execution to drain results until producer closes; producer emits remaining-timeout results. |
| cmd/testvalidator_internal_test.go | Updates expected timeout results and adds a test ensuring timeouts always return non-empty results. |
| cmd/testpeers.go | Refactors peer/self/relay single-target execution similarly; producer emits remaining-timeout results. |
| cmd/testpeers_internal_test.go | Updates expected timeout results for additional testcases and loosens an internal output-consumption assertion. |
| cmd/testmev.go | Refactors MEV per-endpoint execution to drain until close; producer emits remaining-timeout results. |
| cmd/testmev_internal_test.go | Updates expected timeout results and adds a test ensuring each endpoint always has results on timeout. |
| cmd/testinfra.go | Refactors infra single-target execution to drain until close; producer emits remaining-timeout results. |
| cmd/testinfra_internal_test.go | Updates expected timeout results and adds a test ensuring local always has results on timeout. |
| cmd/testbeacon.go | Refactors beacon per-endpoint execution to drain until close; producer emits remaining-timeout results. |
| cmd/testbeacon_internal_test.go | Updates expected timeout results and adds a test ensuring each endpoint always has results on timeout. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4513 +/- ##
==========================================
- Coverage 57.10% 57.03% -0.07%
==========================================
Files 245 245
Lines 32939 32857 -82
==========================================
- Hits 18809 18740 -69
+ Misses 11761 11746 -15
- Partials 2369 2371 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|



Simplify test commands. This should fix the flaky tests.
category: bug
ticket: none