-
Notifications
You must be signed in to change notification settings - Fork 48
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 race in WebConsoleRequest controller tests #828
Conversation
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.
Thanks @dilyar85 !
Could you could also use the atomic package to read/write v1a2ProviderCalled
?
00731ec
to
7937bf6
Compare
Done. I also removed the mutex when reading the var that was added in previous commit, as it's not needed with |
controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_intg_test.go
Show resolved
Hide resolved
7937bf6
to
37aab24
Compare
Minimum allowed line rate is |
What does this PR do, and why is it needed?
This PR fixes a potential race condition in unit tests by changing
v1a2ProviderCaller bool
type toatomic.Bool
. The race could happen if the WebConsoleRequest CR is reconciled multiple times, causing concurrent reads and writes.Which issue(s) is/are addressed by this PR?
Fixes https://github.com/vmware-tanzu/vm-operator/actions/runs/12355794076/job/34480234221?pr=823
Are there any special notes for your reviewer:
N/A
Please add a release note if necessary: