File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+
2+
3+ mktempdir () do tmpdir
4+ fake_bindir = joinpath (tmpdir, " bin" )
5+ fake_srun = joinpath (tmpdir, " bin" , " srun" )
6+ mkpath (fake_bindir)
7+ open (fake_srun, " w" ) do io
8+ println (" #!/usr/bin/env bash" )
9+ println (" set -euf -o pipefail" )
10+ println (" set -x" )
11+ println (" echo INTENTIONALLY ERROR-ING" )
12+ println (" exit 1" )
13+ end
14+
15+
16+ directory_separator = Sys. iswindows () ? ' ;' : ' :'
17+ new_env = Dict ()
18+ new_env[" SLURM_NTASKS" ] = " 8"
19+ new_env[" SLURM_JOB_ID" ] = " 1234"
20+ if haskey (ENV , " PATH" )
21+ old_path = ENV [" PATH" ]
22+ new_env[" PATH" ] = fake_bindir * directory_separator * old_path
23+ else
24+ new_env[" PATH" ] = fake_bindir
25+ end
26+
27+ withenv (new_env... ) do
28+ mgr = SlurmClusterManager. SlurmManager ()
29+ @test_throws ErrorException Distributed. addprocs (mgr)
30+ end
31+ end
You can’t perform that action at this time.
0 commit comments