Skip to content

Commit

Permalink
Disable thread affinity test under rr
Browse files Browse the repository at this point in the history
RR changes the affinity, so 0,1 may not be available in the affinity
mask. It's a bit complicated to fix this test and would require parsing
the existing affinity mask, so just disable it for now.
  • Loading branch information
Keno committed Dec 19, 2020
1 parent ccfbc90 commit 2d0211b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions test/threads.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ let cmd = `$(Base.julia_cmd()) --depwarn=error --startup-file=no threads_exec.jl
end

# issue #34415 - make sure external affinity settings work
if Sys.islinux() && Sys.CPU_THREADS > 1 && Sys.which("taskset") !== nothing
run_with_affinity(spec) = readchomp(`taskset -c $spec $(Base.julia_cmd()) -e "run(\`taskset -p \$(getpid())\`)"`)
@test endswith(run_with_affinity("1"), "2")
@test endswith(run_with_affinity("0,1"), "3")

if Sys.islinux()
const SYS_rrcall_check_presence = 1008
running_under_rr() = 0 == ccall(:syscall, Int,
(Int, Int, Int, Int, Int, Int, Int),
SYS_rrcall_check_presence, 0, 0, 0, 0, 0, 0)
if Sys.CPU_THREADS > 1 && Sys.which("taskset") !== nothing && !running_under_rr()
run_with_affinity(spec) = readchomp(`taskset -c $spec $(Base.julia_cmd()) -e "run(\`taskset -p \$(getpid())\`)"`)
@test endswith(run_with_affinity("1"), "2")
@test endswith(run_with_affinity("0,1"), "3")
end
end

# issue #34769
Expand Down

0 comments on commit 2d0211b

Please sign in to comment.