Skip to content

Commit de3ba67

Browse files
committed
Use env
1 parent c7ac8a3 commit de3ba67

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-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

0 commit comments

Comments
 (0)