unit-race: fix race condition in unit tests#73
Merged
Conversation
Contributor
Author
|
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.
Contributor
Author
|
Yayy, I was able to fix the tests by pinning everything to |
positiveblue
approved these changes
Mar 28, 2022
Contributor
positiveblue
left a comment
There was a problem hiding this comment.
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 ?)
carlaKC
approved these changes
Mar 28, 2022
Contributor
Author
Yeah, typo :) Fixed the comment. Thanks for the review! |
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.
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.