-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 condition in test introduced in #33119 (oops). #34142
Conversation
Introduce synchronization (via a `Channel()`) to force spawned tasks to run after the local variables are updated, showcasing the problem and the solution with `$`-interpolation.
# Without interpolation, each spawned task sees the last value of `i` (6); | ||
# with interpolation, each spawned task has the value of `i` at time of `@spawn`. | ||
let | ||
oneinterp = Vector{Any}(undef, 5) |
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.
Should be 4 spaces instead of 3 for this block
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.
Looks right. Was there a merge conflict at the bottom though? Deleting that other test doesn't seem related.
Ah sorry, the extra test at the bottom was incorrectly deleted via a bad
merge conflict when I was rebasing and squashing for #33119. (Shouldn't be
working remotely from this tiny laptop.)
This PR removes the duplicated tests.
Sorry, should have called that out in the description.
…On Fri, Dec 20, 2019, 1:24 AM Jameson Nash ***@***.***> wrote:
***@***.**** approved this pull request.
Looks right. Was there a merge conflict at the bottom though? Deleting
that other test doesn't seem related.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#34142?email_source=notifications&email_token=AAMCIEKKHSC2NEBZ6QUVZB3QZPGQXA5CNFSM4J45O772YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCP3BOLI#pullrequestreview-334894893>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMCIEIRSIYTWAWQACWKT33QZPGQXANCNFSM4J45O77Q>
.
|
Merged locally as 608567f to fixup the indent and squash the PR. |
Did that fix the wrongly deleted test? |
Thanks a bunch, @vchuravy! <3 @KristofferC, no, sorry, it wasn't wrongly deleted. It was correctly deleted, because #33119 wrongly duplicated it due to a bad merge. Added here: |
I appreciate the parallelism of how this was fixing two race conditions. |
😂 |
Introduce synchronization (via a
Channel()
) to force spawned tasks torun after the local variables are updated, showcasing the problem and
the solution with
$
-interpolation.Fixes race condition in test introduced in #33119.
Fixes #34141.