-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Mock issues in Go 1.5 #553
Comments
Off the top of my head it sounds like a race condition exposed by 1.5's change to the default |
I'm seeing the test failures in the file that covers our sarama extraction -- both the producer and consumer are used there. A race condition is likely. I commented out all but the first test, and saw a panic due to nil pointer at first. After adding a logging statement to the sarama source, then removing it, the test now fails with no panic. And running with I have also tried running with |
I just saw it fail, and then pass, with the Further evidence of a race condition:
|
It's not super-clear to me, but based on those logs could it be an actual bug in your code that's been uncovered? The mock code involved is fairly simple and protected by a mutex: you're telling it to expect |
@eapache I have found a race condition in my code; I was naively assuming loop index order was preserved. I have another race condition which is not so simple however. Tests now pass most of the time, but sometimes, some of the messages inserted with |
I don't see one off the top of my head. @wvanbergen why does |
Several of our tests using
github.com/Shopify/sarama/mocks
are failing in Go 1.5.1 due to count mismatches between expected/actual offsets and the like. The same test suite passes when run with Go 1.4.2.Have you seen any difference in test code that uses
mocks
with Go 1.5?The text was updated successfully, but these errors were encountered: