-
Notifications
You must be signed in to change notification settings - Fork 6
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: latency test race condition #29
Conversation
Race cond. still present: https://github.com/caas-team/sparrow/actions/runs/7099127501/job/19323035475 |
Ready for review. This PR now also partly addresses #31 but needs to be extended in another PR for the health check and other refinements. |
And after merging it should also close #33 since I've refactored the latency check to be more lined up with the health check |
Signed-off-by: Bruno Bressi <[email protected]>
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.
LGTM; @y-eight / @niklastreml I'll wait for your review as well before merging.
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.
LGTM
Motivation
Address a race condition found within the
check
method of the Latency Check. The race condition was caused by the concurrent goroutines capturing the loop variablee
from thefor
loop, leading to unpredictable behavior as this variable was shared across all goroutines.Closes #27
Changes
Introduced a local copy of the loop variable in the
for
loop to ensure each goroutine receives a unique, stable copy of the target URL.For additional information look at the commits.
Tests done
The unit tests succeed now.
TODO