test: fixup synctest usage in crdbpool#2910
Merged
tstirrat15 merged 1 commit intomainfrom Feb 23, 2026
Merged
Conversation
faa3910 to
e38f426
Compare
tstirrat15
commented
Feb 19, 2026
|
|
||
| retryPool := createTestRetryPool(testPool) | ||
| ctx, cancel := context.WithCancel(context.Background()) | ||
| ctx, cancel := context.WithCancel(t.Context()) |
Contributor
Author
There was a problem hiding this comment.
Not sure why testifylint didn't catch this
| deadline, hasDeadline := acquireContext.Deadline() | ||
| assert.True(t, hasDeadline, "acquire context should have a deadline") | ||
| expectedDeadline := startTime.Add(acquireTimeout) | ||
| assert.Equal(t, expectedDeadline, deadline, "deadline should be correct") |
Contributor
Author
There was a problem hiding this comment.
This is the only change that isn't rewrapping or adding synctest.Wait - with synctest the time values are exact, so we can assert directly on them without relying on bounds.
miparnisari
reviewed
Feb 19, 2026
| }) | ||
|
|
||
| require.Error(t, err) | ||
| require.Error(t, err) //nolint:testifylint // we're inside a goroutine so this is appropriate |
Contributor
There was a problem hiding this comment.
you wrote the same comment on line 109 but with assert???
Contributor
Author
There was a problem hiding this comment.
Yep, that was incorrect.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2910 +/- ##
==========================================
- Coverage 74.54% 74.51% -0.02%
==========================================
Files 484 484
Lines 59228 59228
==========================================
- Hits 44145 44130 -15
- Misses 11990 12001 +11
- Partials 3093 3097 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e38f426 to
d4cade4
Compare
miparnisari
approved these changes
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-on to #2754
Description
Synctest runs its tests inside special goroutines, which means we need to use
assertinside of them (at least as I understand it; I might be wrong on this point).We also want to
Wait()to ensure that all goroutines have settled.Changes
Testing
Review.