Skip to content

Commit 0d21397

Browse files
KenoKristofferC
authored andcommitted
Disable thread affinity test under rr
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. (cherry picked from commit 2d0211b)
1 parent f452173 commit 0d21397

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

test/threads.jl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@ let cmd = `$(Base.julia_cmd()) --depwarn=error --startup-file=no threads_exec.jl
77
end
88

99
# issue #34415 - make sure external affinity settings work
10-
if Sys.islinux() && Sys.CPU_THREADS > 1 && Sys.which("taskset") !== nothing
11-
run_with_affinity(spec) = readchomp(`taskset -c $spec $(Base.julia_cmd()) -e "run(\`taskset -p \$(getpid())\`)"`)
12-
@test endswith(run_with_affinity("1"), "2")
13-
@test endswith(run_with_affinity("0,1"), "3")
10+
11+
if Sys.islinux()
12+
const SYS_rrcall_check_presence = 1008
13+
running_under_rr() = 0 == ccall(:syscall, Int,
14+
(Int, Int, Int, Int, Int, Int, Int),
15+
SYS_rrcall_check_presence, 0, 0, 0, 0, 0, 0)
16+
if Sys.CPU_THREADS > 1 && Sys.which("taskset") !== nothing && !running_under_rr()
17+
run_with_affinity(spec) = readchomp(`taskset -c $spec $(Base.julia_cmd()) -e "run(\`taskset -p \$(getpid())\`)"`)
18+
@test endswith(run_with_affinity("1"), "2")
19+
@test endswith(run_with_affinity("0,1"), "3")
20+
end
1421
end
1522

1623
# issue #34769

0 commit comments

Comments
 (0)