-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Save some time on some tests using synctest #19112
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
Conversation
Saving some time on some slow tests using [synctest](https://pkg.go.dev/testing/synctest). Slow tests pulled from changes in vitessio#19076. Before: ``` Signed-off-by: Mohamed Hamza <[email protected]> --- PASS: TestSleepTablet (15.01s) --- PASS: TestSleepTablet/default_sleep_duration (15.00s) --- PASS: TestEmergencyReparentShardSlow (0.00s) --- PASS: TestEmergencyReparentShardSlow/nil_WaitReplicasTimeout_and_request_takes_29_seconds_is_ok (29.00s) --- PASS: TestEmergencyReparentShardSlow/nil_WaitReplicasTimeout_and_request_takes_31_seconds_is_error (30.00s) --- PASS: TestPlannedReparentShardSlow (0.00s) --- PASS: TestPlannedReparentShardSlow/nil_WaitReplicasTimeout_and_request_takes_29_seconds_is_ok (28.01s) --- PASS: TestPlannedReparentShardSlow/nil_WaitReplicasTimeout_and_request_takes_31_seconds_is_error (30.00s) ok vitess.io/vitess/go/vt/vtctl/grpcvtctldserver 30.854s ``` After: ``` --- PASS: TestSleepTablet (0.00s) --- PASS: TestSleepTablet/default_sleep_duration (0.00s) --- PASS: TestEmergencyReparentShardSlow (0.00s) --- PASS: TestEmergencyReparentShardSlow/nil_WaitReplicasTimeout_and_request_takes_29_seconds_is_ok (0.01s) --- PASS: TestEmergencyReparentShardSlow/nil_WaitReplicasTimeout_and_request_takes_31_seconds_is_error (0.00s) --- PASS: TestPlannedReparentShardSlow (0.00s) --- PASS: TestPlannedReparentShardSlow/nil_WaitReplicasTimeout_and_request_takes_29_seconds_is_ok (0.01s) --- PASS: TestPlannedReparentShardSlow/nil_WaitReplicasTimeout_and_request_takes_31_seconds_is_error (0.01s) ok vitess.io/vitess/go/vt/vtctl/grpcvtctldserver 0.880s ``` Signed-off-by: Mohamed Hamza <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #19112 +/- ##
=======================================
Coverage 69.89% 69.90%
=======================================
Files 1612 1612
Lines 215826 215826
=======================================
+ Hits 150857 150863 +6
+ Misses 64969 64963 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Nice! I made a similar attempt to speed up other test cases here: #18701 My main concern is around back ports. Synctest was added in go 1.25, but on v22 we are still using go 1.24 so adding this in too many places will potentially make back ports a bit more complicated. But I think there's going to be a lot of test cases where the improvement is so significant that we can still make this trade off. 👍 |
mattlord
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.
❤️
Description
Saving some time on some slow tests using synctest. Slow tests pulled from changes in #19076.
Before:
After:
Related Issue(s)
Checklist
Deployment Notes
AI Disclosure