From 93c1fc3c1f2e702cd961f4ce424a7ae697c858d0 Mon Sep 17 00:00:00 2001 From: TapTap Date: Tue, 15 Sep 2026 20:02:00 +0200 Subject: [PATCH] test: create fault-injection destination root in seeding fixture The captured_config fixture assumed fault_dst already existed, relying on earlier tests in the same xdist worker creating it via _recover. Under --dist=load a worker can receive the capture test first, so the receiver rejected a missing destination root and the capture run failed. Create DEST_DIR in the autouse seeding fixture so test order/distribution cannot matter. --- tests/integration/test_fault_injection.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/integration/test_fault_injection.py b/tests/integration/test_fault_injection.py index 1319885..df2f607 100644 --- a/tests/integration/test_fault_injection.py +++ b/tests/integration/test_fault_injection.py @@ -59,6 +59,10 @@ def _seed_source(): if os.path.exists(SOURCE_DIR): shutil.rmtree(SOURCE_DIR) os.makedirs(os.path.join(SOURCE_DIR, "nested")) + # The receiver rejects a destination root that does not exist, and the + # capture fixture can run before any test that creates it, so create it + # here (test order/distribution must not matter). + os.makedirs(DEST_DIR, exist_ok=True) with open(os.path.join(SOURCE_DIR, "hello.txt"), "wb") as fh: fh.write(b"fault injection payload\n" * 64) with open(os.path.join(SOURCE_DIR, "nested", "deep.bin"), "wb") as fh: