Skip to content

Commit 28444f9

Browse files
committed
Use env
1 parent c7ac8a3 commit 28444f9

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.github/workflows/UnitTests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ concurrency:
2929
group: ${{ github.workflow }}-${{ github.ref }}
3030
cancel-in-progress: true
3131

32+
env:
33+
PARALLELTESTRUNNER_NUM_JOBS: 3
34+
3235
jobs:
3336
test:
3437
runs-on: ${{ matrix.os }}

src/ParallelTestRunner.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ function default_njobs(; cpu_threads = Sys.CPU_THREADS, free_memory = available_
362362
@show free_memory
363363
memory_jobs = Int64(free_memory) ÷ (2 * 2^30)
364364
@show memory_jobs
365-
return max(1, min(jobs, memory_jobs))
365+
env_var_num_jobs = tryparse(Int, get(ENV, "PARALLELTESTRUNNER_NUM_JOBS", ""))
366+
return something(env_var_num_jobs, max(1, min(jobs, memory_jobs)))
366367
end
367368

368369
# Historical test duration database

test/runtests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,4 +223,8 @@ end
223223
@test contains(str, "SUCCESS")
224224
end
225225

226+
@testset begin
227+
@test ParallelTestRunner.default_njobs() == 3
228+
end
229+
226230
end

0 commit comments

Comments
 (0)