-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Distributed test suite: if Threads.nthreads() > 1
, skip certain tests
#42764
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.
Yes, I think it's nice to mark thread-incompatible tests like this.
@tkf Should we rename some of the other functions to reflect the new name of the environment variable? |
Yeah, maybe that's a good idea since it'd make it easy to move this to testhelper later if we want to use it elsewhere. |
Any suggestions on a good naming scheme? |
I think reflecting the environment variable, like you initially did, is a good approach. So |
What about the naming for skipping tests? Right now we have: if run_distributed_multithreaded()
@test f()
end Maybe something like: if !skip_this_test_if_multithreaded()
@test f()
end I don't love the double negative though..... |
I like "skip" here since it is similar to |
Marking this as a draft until I finish the renaming. |
889f823
to
e93654d
Compare
I'd like to avoid using double negatives, so I chose to go with The environment variable is now named And the function is now named |
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!
e93654d
to
f5a4da3
Compare
I'm going to wait for CI to finish, and then I'll check the CI logs to make sure the warning correctly shows up in the logs of the multi-threaded CI jobs. |
f5a4da3
to
2cb21db
Compare
The Buildkite logs look correct. This PR is good to merge once CI is green. |
If Distributed needs to be tested both threaded and unthreaded it should just do so, like: Lines 5 to 11 in d39b2c0
It should not be an external "setting" so that to fully test Julia, one needs to run the full test suite multiple times with the different settings when 99%+ of the tests execute exactly the same no matter that setting. |
This is incorrect. The entire Julia test suite needs to be run both singlethreaded and multithreaded, at least on a single platform. There are bugs that only show up in one case versus the other. Just off the top of my head, there was a test for one of the invalid sysimage code paths that passed when singlethreaded but failed when multithreaded. More specifically, we were testing that there would not be a segfault when exercising a certain code path. However, when we ran the tests with multiple threads enabled, the test segfaulted. This indicated that there was a bug in this particular code path. That test was not part of the Distributed test suite. |
This is just not true. There are all kinds of subtle bugs in Julia that are absent when threading is disabled and are present when threading is enabled. The only way to test for these bugs is to run the test suite both with and without threading. As I said on Slack, in order to conserve CI resources, we only do this on linux64. On linux64, we run the test suite both with and without threading. On all other architectures and operating systems, we only run the test suite once. |
…ts (JuliaLang/julia#42764) (cherry picked from commit 2cfdbec)
Threads.nthreads() == 1
, then we will run all tests.Threads.nthreads() > 1
:ENV["JULIA_TEST_INCLUDE_THREAD_UNSAFE"] == "true"
, then we will run all tests.