-
Notifications
You must be signed in to change notification settings - Fork 2.3k
test: showcase using synctest
#18701
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
Signed-off-by: Arthur Schreiber <[email protected]>
Signed-off-by: Arthur Schreiber <[email protected]>
Signed-off-by: Arthur Schreiber <[email protected]>
Signed-off-by: Arthur Schreiber <[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
|
sync testsynctest
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18701 +/- ##
==========================================
- Coverage 67.51% 67.50% -0.02%
==========================================
Files 1608 1608
Lines 263594 263604 +10
==========================================
- Hits 177973 177947 -26
- Misses 85621 85657 +36 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Arthur Schreiber <[email protected]>
|
This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:
If no action is taken within 7 days, this PR will be closed. |
Description
synctestis a new builtin go package that was marked as stable in 1.25. It allows execution of time based test (e.g. those that test timeouts via context etc) without actually spending time waiting for the given timeout to fire.See the documentation at https://pkg.go.dev/testing/synctest and Testing concurrent code with testing/synctest for more information on how this works. Using this package for unit tests is pretty straightforward and painless, and has huge potential to improve test runtimes.
In this PR, I'm updating the vstream manager unit tests that effectively test passing time. Just wrapping these tests in
synctest.Testyields a test execution time reduction of 97.5%.Before
After
Related Issue(s)
Checklist
Deployment Notes
AI Disclosure