Skip to content

Commit

Permalink
Fix precompile pidlock test failure on Base CI (#3531)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth authored Jul 2, 2023
1 parent 2d5f98a commit e8197dd
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions test/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,24 @@ end

@testset "pidlocked precompile" begin
proj = joinpath(pwd(), "packages", "SlowPrecompile")
cmd = setenv(`$(Base.julia_cmd()) --color=no --startup-file=no --project="$(pkgdir(Pkg))" -e "
cmd = addenv(`$(Base.julia_cmd()) --color=no --startup-file=no --project="$(pkgdir(Pkg))" -e "
using Pkg
Pkg.activate(\"$(escape_string(proj))\")
Pkg.precompile()
"`,
"JULIA_PKG_PRECOMPILE_AUTO" => "0")
iob1 = IOBuffer()
iob2 = IOBuffer()
Base.Experimental.@sync begin
@async run(pipeline(cmd, stderr=iob1, stdout=devnull))
@async run(pipeline(cmd, stderr=iob2, stdout=devnull))
try
Base.Experimental.@sync begin
@async run(pipeline(cmd, stderr=iob1, stdout=iob1))
@async run(pipeline(cmd, stderr=iob2, stdout=iob2))
end
catch
println("pidlocked precompile tests failed:")
println("process 1:\n", String(take!(iob1)))
println("process 2:\n", String(take!(iob2)))
rethrow()
end
s1 = String(take!(iob1))
s2 = String(take!(iob2))
Expand Down

0 comments on commit e8197dd

Please sign in to comment.