-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Race Condition: Test.@test_logs is not thread safe. #54439
Copy link
Copy link
Closed
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorgood first issueIndicates a good issue for first-time contributors to JuliaIndicates a good issue for first-time contributors to JuliamultithreadingBase.Threads and related functionalityBase.Threads and related functionalitytestsystemThe unit testing framework and Test stdlibThe unit testing framework and Test stdlib
Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorgood first issueIndicates a good issue for first-time contributors to JuliaIndicates a good issue for first-time contributors to JuliamultithreadingBase.Threads and related functionalityBase.Threads and related functionalitytestsystemThe unit testing framework and Test stdlibThe unit testing framework and Test stdlib
EDIT: changed to a much simpler example that shows the issue.
The
@test_logsmacro is not thread safe, if the code under test uses multiple threads:This is definitely a bug, and should be fixed.
We see this showing up in our CI build farm from time to time.
The solution is almost certainly to make that vector thread-safe, by introducing a lock around it, and then copying the vector out before returning.