Repository navigation
test: add t.Parallel() to util collections, io, rand, security tests (#27423) - #27771
Conversation
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #27771 +/- ##
==========================================
- Coverage 63.98% 63.98% -0.01%
==========================================
Files 421 421
Lines 57774 57774
==========================================
- Hits 36968 36967 -1
+ Misses 17327 17325 -2
- Partials 3479 3482 +3 ☔ View full report in Codecov by Harness. |
4a8a406 to
ef5b7cb
Compare
blakepettersson
left a comment
There was a problem hiding this comment.
@GuruduGanesh do we have any benchmarks showing if this is faster than baseline? You also need to set DCO for your commit
git commit --amend -s
ef5b7cb to
6bcf4e2
Compare
|
Thanks for the review. I fixed the DCO issue by amending the commit with a matching sign-off:
Test Runtime Comparison
Raw Stats From 9 Runs
This is a small utility-test slice, so I do not expect a dramatic standalone improvement. The data shows a modest improvement when package-level parallelism is controlled, and roughly noise-level improvement under default package parallelism. The main goal is to contribute a safe incremental batch toward #27423. |
…rgoproj#27423) Signed-off-by: Ganesh Gurudu <ganesh.gurudu@gmail.com>
6bcf4e2 to
0e8e968
Compare
nitishfy
left a comment
There was a problem hiding this comment.
can you provide a justification on how these Parallel tests won't lead to race conditions when they're running parallely especially in CI?
@nitishfy - Thanks for raising this. I limited The repo's race test path (
I intentionally did not parallelize the tests that could be order- or lifecycle-sensitive:
I also verified the touched package set with race detection and repeated shuffled runs: make TEST_MODULE="./util/collections ./util/io ./util/io/path ./util/rand ./util/security" test-race-local
go test ./util/collections ./util/io ./util/io/path ./util/rand ./util/security -shuffle=on -count=10
|
blakepettersson
left a comment
There was a problem hiding this comment.
LGTM, but for the next time I would love to see more impactful changes in terms of test runtime. Bring on some bigger changes! 😄
|
@nitishfy mind removing your "request changes"? |
|
Hi @nitishfy, just following up on this. I’ve addressed your concern about race safety with per-file reasoning and verified the touched packages using race detection and shuffled repeated runs. Since the PR now has approvals and auto-merge is enabled, could you please take another look and remove the “request changes” if there are no remaining concerns? Thanks again for your review and guidance. |
…rgoproj#27423) (argoproj#27771) Signed-off-by: Ganesh Gurudu <ganesh.gurudu@gmail.com>
…(#27423)
Description
Refs #27423.
Adds
t.Parallel()to a small batch of utility unit tests where the tests are isolated and safe to run in parallel.This updates tests under:
util/collectionsutil/ioutil/io/pathutil/randutil/securityTestGetPathIfExistsis intentionally left sequential because its subtests share the sameRandomizedTempPathsinstance and depend on execution order. The"does not exist"case must run before the"does exist"case populates the path.TestGetPaths_no_raceis also intentionally left sequential because it is a race smoke test that starts goroutines usingtesting.T.For timing, I compared the touched package set against
upstream/masterwithgo test ... -count=50. This small utility batch does not show a meaningful standalone speedup; timings were noise-level equivalent. This PR is intended as a small, low-risk slice of #27423.Testing
Checklist: