mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-07-04 13:23:15 +02:00
Fix coverage race: delete stale .coverage* files before each package test run
Parallel cgroup subprocesses racing on the same .coverage SQLite DB caused INTERNALERROR (no such table: meta/arc) when combining coverage data files. Delete all .coverage* files before each package run to prevent corruption.
This commit is contained in:
parent
7945d384c5
commit
6008a4034a
@ -95,6 +95,10 @@ def main() -> int:
|
||||
# instantly at the limit instead of thrashing swap/zram.
|
||||
use_cgroup = shutil.which("systemd-run") is not None
|
||||
for pkg in sorted(packages):
|
||||
# Remove stale .coverage* files before each package run to prevent
|
||||
# SQLite corruption when combining parallel coverage data files.
|
||||
for stale in Path().glob(".coverage*"):
|
||||
stale.unlink(missing_ok=True)
|
||||
cmd = _build_pytest_command({pkg})
|
||||
if use_cgroup:
|
||||
cmd = [
|
||||
|
||||
Loading…
Reference in New Issue
Block a user