-
-
Notifications
You must be signed in to change notification settings - Fork 270
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
Changed Pkg.test to prioritise julia_args --threads over current process threads #4141
base: master
Are you sure you want to change the base?
Conversation
…ess threads Ensures that tests run with threads, both when calling `julia --project --threads=auto --eval 'using Pkg; Pkg.test()'`, and when calling `julia --project --eval 'using Pkg; Pkg.test(; julia_args = ["--threads=auto"])'`.
Makes sense. Can you add a test |
Not completely sure how to properly add this test, but what I am aiming for is something similar to running the following for the added EXPECTED_NTHREADS=1 julia +nightly --project --eval 'using Pkg; Pkg.test()'
EXPECTED_NTHREADS=2 julia +nightly --project --threads=2 --eval 'using Pkg; Pkg.test()'
EXPECTED_NTHREADS=2 julia +nightly --project --eval 'using Pkg; Pkg.test(; julia_args=["--threads=2"])'
EXPECTED_NTHREADS=1 julia +nightly --project --threads=2 --eval 'using Pkg; Pkg.test(; julia_args=["--threads=1"])' Edit: This is the behaviour on Julia 1.6, and 1.10. |
I guess, one could also add:
|
Any suggestions for how to implement the tests? |
Take a look at existing test packages and add one that can be called by |
Just a passing comment that this should probably account for and test both threadpools |
Did something change post-Julia-1.11, that remedied the issue with passing |
@@ -2276,7 +2276,7 @@ function test(ctx::Context, pkgs::Vector{PackageSpec}; | |||
printpkgstyle(ctx.io, :Testing, "Running tests...") | |||
flush(ctx.io) | |||
code = gen_test_code(source_path; test_args) | |||
cmd = `$(Base.julia_cmd()) $(flags) --eval $code` | |||
cmd = Cmd(`$(Base.julia_cmd()) $(flags) --eval $code`; env = julia_args.env) |
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.
What about the other parts of the julia_args
Cmd
?
Is it safe to ignore julia_args.cpus
, julia_args.dir
, julia_args.flags
(!= flags
), and julia_args.ignorestatus
?
ad66721
to
304fffd
Compare
Changed Pkg.test to prioritise julia_args --threads over current process threads
Ensures that tests run with threads, both when calling
julia --project --threads=auto --eval 'using Pkg; Pkg.test()'
, and when callingjulia --project --eval 'using Pkg; Pkg.test(; julia_args = ["--threads=auto"])'
.Similar to #4140