Skip to content

Commit ad85648

Browse files
joyeecheungaduh95
authored andcommitted
test: parallelize sea tests when there's enough disk space
The sea tests are only run sequentially to avoid taking too much disk space. When there is enough disk space, however, it's better to run them in parallel, as these tests tend to be slow. PR-URL: #60604 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
1 parent 41c0a34 commit ad85648

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

‎test/sea/testcfg.py‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1-
importsys, os
1+
importsys, os, multiprocessing, shutil
22
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
33
importtestpy
44

55
defGetConfiguration(context, root):
6-
returntestpy.SimpleTestConfiguration(context, root, 'sea')
6+
# We don't use arch-specific out folder in Node.js; use none/none to auto
7+
# detect release mode from GetVm and get the path to the executable.
8+
vm=context.GetVm('none', 'none')
9+
ifnotos.path.isfile(vm):
10+
returntestpy.SimpleTestConfiguration(context, root, 'sea')
11+
12+
# Get the size of the executable to decide whether we can run tests in parallel.
13+
executable_size=os.path.getsize(vm)
14+
num_cpus=multiprocessing.cpu_count()
15+
remaining_disk_space=shutil.disk_usage('.').free
16+
# Give it a bit of leeway by multiplying by 3.
17+
if (executable_size*num_cpus*3>remaining_disk_space):
18+
returntestpy.SimpleTestConfiguration(context, root, 'sea')
19+
20+
returntestpy.ParallelTestConfiguration(context, root, 'sea')

0 commit comments

Comments
(0)