Skip to content
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

Test suite tweaks for rr #35539

Merged
merged 5 commits into from
Dec 19, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Don't detach rr workers in SharedArrays tests
By default, I'm having the test suite set up to put any workers spawned
with addprocs into their own rr sessions. This doesn't work with SharedArrays,
because those workers share memory with the main process. Add a new JULIA_RR
environment variable that specifies which rr to use for the test suite and
a flag to the testsuite's addprocs command to determine whether or not to
detach the workers from the current rr session.
  • Loading branch information
Keno committed Dec 19, 2020
commit ccfbc909a3f1d11c82b70b3be33f7c206d0641a0
4 changes: 3 additions & 1 deletion stdlib/SharedArrays/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
using Test, Distributed, SharedArrays, Random
include(joinpath(Sys.BINDIR, "..", "share", "julia", "test", "testenv.jl"))

addprocs_with_testenv(4)
# These processes explicitly want to share memory, we can't have
# them in separate rr sessions
addprocs_with_testenv(4; rr_allowed=false)
@test nprocs() == 5

@everywhere using Test, SharedArrays
Expand Down
11 changes: 10 additions & 1 deletion test/testenv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,16 @@ if !@isdefined(testenv_defined)
const test_exename = popfirst!(test_exeflags.exec)
end

addprocs_with_testenv(X; kwargs...) = addprocs(X; exename=test_exename, exeflags=test_exeflags, kwargs...)
if haskey(ENV, "JULIA_RR")
const rr_exename = `$(Base.shell_split(ENV["JULIA_RR"]))`
else
const rr_exename = ``
end

function addprocs_with_testenv(X; rr_allowed=true, kwargs...)
exename = rr_allowed ? `$rr_exename $test_exename` : test_exename
addprocs(X; exename=exename, exeflags=test_exeflags, kwargs...)
end

const curmod = @__MODULE__
const curmod_name = fullname(curmod)
Expand Down