Skip to content

Commit 0b3a4ba

Browse files
committed
Add retries to collecting coverage report on windows
1 parent ea08cf9 commit 0b3a4ba

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2398,16 +2398,26 @@ def python_coverage(args):
23982398
'--strict-mode',
23992399
'--tags', args.tags,
24002400
] + jacoco_args, env=env)
2401-
mx.run_mx([
2402-
'--strict-compliance',
2403-
'--kill-with-sigquit',
2404-
'jacocoreport',
2405-
'--format', 'lcov',
2406-
'--omit-excluded',
2407-
'coverage',
2408-
'--generic-paths',
2409-
'--exclude-src-gen',
2410-
], env=env)
2401+
# On windows, the command can fail if the file is still locked by lingering test processes
2402+
retries = 3 if WIN32 else 1
2403+
while True:
2404+
retval = mx.run_mx([
2405+
'--strict-compliance',
2406+
'--kill-with-sigquit',
2407+
'jacocoreport',
2408+
'--format', 'lcov',
2409+
'--omit-excluded',
2410+
'coverage',
2411+
'--generic-paths',
2412+
'--exclude-src-gen',
2413+
], env=env)
2414+
if retval == 0:
2415+
break
2416+
retries -= 1
2417+
if not retries:
2418+
sys.exit("Failed to collect coverage report")
2419+
time.sleep(10)
2420+
24112421
if args.mode == 'truffle':
24122422
executable = graalpy_standalone_jvm()
24132423
file_filter = f"*lib-graalpython*,*graalpython/include*,*com.oracle.graal.python.cext*,*lib/graalpy{graal_version_short()}*,*include/python{py_version_short()}*"

0 commit comments

Comments
 (0)