-
Notifications
You must be signed in to change notification settings - Fork 983
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
Fix metrics controller races #1379
Conversation
✔️ Deploy Preview for karpenter-docs-prod canceled. 🔨 Explore the source changes: fa560ee 🔍 Inspect the deploy log: https://app.netlify.com/sites/karpenter-docs-prod/deploys/621e8fc178b08100081ed257 |
03733db
to
5fcbe73
Compare
I'm a bit wary of
|
You can build with -race, though it will run much slower. That's probably the best solution as a -race e2e test should negate the need for this entirely.
On the other hand, the test does expose two bugs :)
The 50 objects * 5 runs was to hopefully trip an issue like a concurrent map write during normal unit tests. You can just create two objects and run them once to trigger detection with the race detector, so time should be negligible in that case. Possible solution is to just fix the two bugs and create an issue to ensure that at least some e2e test runs on a -race build? |
Perfect. |
b09bd3d
to
4d291a8
Compare
- use a sync.Map - make some struct members non-public - add some tests that exercise the maps
1. Issue, if available:
N/A
2. Description of changes:
add some race testing and fix two identified issues
3. How was this change tested?
ginkgo -r --race
4. Does this change impact docs?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.