diff --git a/src/Operations.jl b/src/Operations.jl index c2ac100e5b..4777d10e91 100644 --- a/src/Operations.jl +++ b/src/Operations.jl @@ -2060,19 +2060,21 @@ function test(ctx::Context, pkgs::Vector{PackageSpec}; test_fn !== nothing && test_fn() sandbox_ctx = Context(;io=ctx.io) status(sandbox_ctx.env, sandbox_ctx.registries; mode=PKGMODE_COMBINED, io=sandbox_ctx.io, ignore_indent = false, show_usagetips = false) - flags = gen_subprocess_flags(source_path; coverage,julia_args) + precompile_julia_args = Cmd(filter(!startswith("--threads"), julia_args.exec)) # precompilation with threads is not supported + precompile_flags = gen_subprocess_flags(source_path; coverage, julia_args = precompile_julia_args) if should_autoprecompile() - cacheflags = Base.CacheFlags(parse(UInt8, read(`$(Base.julia_cmd()) $(flags) --eval 'show(ccall(:jl_cache_flags, UInt8, ()))'`, String))) + cacheflags = Base.CacheFlags(parse(UInt8, read(`$(Base.julia_cmd()) $(precompile_flags) --eval 'show(ccall(:jl_cache_flags, UInt8, ()))'`, String))) Pkg.activate(sandbox_ctx.env.project_file; #=io=devnull=#) do - Pkg.precompile(sandbox_ctx; io=sandbox_ctx.io, configs = flags => cacheflags) + Pkg.precompile(sandbox_ctx; io=sandbox_ctx.io, configs = precompile_flags => cacheflags) end end printpkgstyle(ctx.io, :Testing, "Running tests...") flush(ctx.io) code = gen_test_code(source_path; test_args) - cmd = `$(Base.julia_cmd()) $(flags) --threads=$(get_threads_spec()) --eval $code` + flags = gen_subprocess_flags(source_path; coverage, julia_args = julia_args) + cmd = `$(Base.julia_cmd()) --threads=$(get_threads_spec()) $(flags) --eval $code` p, interrupted = subprocess_handler(cmd, ctx, sandbox_ctx, "Tests interrupted. Exiting the test process") if success(p) printpkgstyle(ctx.io, :Testing, pkg.name * " tests passed ")