Added successful case for context pool, returns before timeout#94
Merged
camdencheek merged 3 commits intoFeb 27, 2023
Merged
Conversation
26636b3 to
f9863b0
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #94 +/- ##
=======================================
Coverage 99.30% 99.30%
=======================================
Files 12 12
Lines 429 429
=======================================
Hits 426 426
Misses 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3a649ad to
70d1ff6
Compare
camdencheek
reviewed
Feb 27, 2023
| } | ||
| }) | ||
| require.NoError(t, p.Wait()) | ||
| }) |
Contributor
There was a problem hiding this comment.
Hey! I was just going to merge this (sorry for the delay), but noticed that this test case is inherently racy. Basically, we can't know for sure that the goroutine will be scheduled before the context times out, so time.After() may trigger after ctx.Done().
I've pushed a commit that uses a context that does not time out instead.
camdencheek
approved these changes
Feb 27, 2023
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I think we need an example of, if the tasks return before the context cancelled due to timeout, it should success