-
Notifications
You must be signed in to change notification settings - Fork 59
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
unit-race: fix race condition in unit tests #73
Conversation
Okay, weird, the one race condition is still there. Didn't happen locally with |
0415aed
to
19f91ae
Compare
To avoid running into an issue in the race unit test with the Prometheus histogram metrics that aren't concurrency safe, we don't register any of them if Prometheus isn't enabled in the first place. This shouldn't be an issue in production, since we don't start multiple instances of Aperture _within the same process_ at the same time.
There's a race condition in the h2_bundle.go of go 1.16.10 and later. The issue golang/go#51799 mentions that this might be fixed in go 1.19, so we'll need to wait for that. We make sure we build our docker images with go 1.16.9 to not run into the issue in the wild.
Yayy, I was able to fix the tests by pinning everything to |
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.
Amazing!!! 🔥
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.
Just of the travis migrations this PR deserves a big approve 🎉 🎉
(I guess that you meant that you uploaded go to version 1.16.9
instead of 1.18.9
?)
Yeah, typo :) Fixed the comment. Thanks for the review! |
Fixes #71.
Turns out the problem was the histogram metrics for Prometheus added recently. They aren't concurrency safe. Since we don't start multiple instances of Aperture within the same process in production, we should never hit that outside of race unit tests.
We also move over to GitHub Actions because Travis sucks.