| 1 |
# Create a directory with 20 files and check the number of pools and workers per pool that lit will use. |
| 2 |
|
| 3 |
# RUN: rm -Rf %t.dir && mkdir -p %t.dir |
| 4 |
# RUN: %{python} -c "for i in range(20): open(rf'%t.dir/file{i}.txt', 'w').write('RUN:')" |
| 5 |
|
| 6 |
# RUN: echo "import lit.formats" > %t.dir/lit.cfg |
| 7 |
# RUN: echo "config.name = \"top-level-suite\"" >> %t.dir/lit.cfg |
| 8 |
# RUN: echo "config.suffixes = [\".txt\"]" >> %t.dir/lit.cfg |
| 9 |
# RUN: echo "config.test_format = lit.formats.ShTest()" >> %t.dir/lit.cfg |
| 10 |
|
| 11 |
|
| 12 |
# 15 workers per pool max, 100 workers total max: we expect lit to cap the workers to the number of files |
| 13 |
# RUN: env "LIT_WINDOWS_MAX_WORKERS_PER_POOL=15" %{lit} -s %t.dir/ -j100 > %t.out 2>&1 |
| 14 |
# CHECK: Using 2 pools balancing 20 workers total distributed as [10, 10] |
| 15 |
# CHECK: Passed: 20 |
| 16 |
|
| 17 |
# 5 workers per pool max, 17 workers total max |
| 18 |
# RUN: env "LIT_WINDOWS_MAX_WORKERS_PER_POOL=5" %{lit} -s %t.dir/ -j17 >> %t.out 2>&1 |
| 19 |
# CHECK: Using 4 pools balancing 17 workers total distributed as [5, 4, 4, 4] |
| 20 |
# CHECK: Passed: 20 |
| 21 |
|
| 22 |
# 19 workers per pool max, 19 workers total max |
| 23 |
# RUN: env "LIT_WINDOWS_MAX_WORKERS_PER_POOL=19" %{lit} -s %t.dir/ -j19 >> %t.out 2>&1 |
| 24 |
# CHECK-NOT: workers total distributed as |
| 25 |
# CHECK: Passed: 20 |
| 26 |
|
| 27 |
# RUN: cat %t.out | FileCheck %s |