-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Release lock before .WaitUntil #171
Conversation
…ng parallel objects. Address stretchr#167: Unable to test concurrent objects
@anpez could you add a test so we avoid regressions in the future? |
Agree |
@anpez small nudge, the tests from this PR are not passing :) |
Fixed it! Looks like since I wrote it, some code around it changed :) |
}() | ||
|
||
// Allow the first call to execute, so the second one executes afterwards | ||
ch2 <- time.Now() |
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.
Maybe it would be good to have each go func()
write something and assert the order is correct at the end of the test?
Release lock before .WaitUntil
Release the lock before .WaitUntil prevents deadlocks when testing parallel objects.
Address #167: Unable to test concurrent objects