From c85c212c6ffdada3ba6b275cf33d358b52a1dd48 Mon Sep 17 00:00:00 2001 From: James Molet Date: Thu, 9 Jul 2026 10:46:14 -0400 Subject: [PATCH] fix: Replace get_nowait() with get(timeout=5) in multiprocessing test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit get_nowait() raises _queue.Empty when the forked child process tries to read from the queue before serialized data is available. This is a race condition that triggers ~20% of the time under CPU pressure (e.g. Koji mock/nspawn builds). Using get(timeout=5) gives the child process time to receive the serialized INIConfig object, matching the pattern already used by the parent process on the result queue. Reproducer: 200 parallel stress runs — 39/200 failed before fix, 0/200 failed after. Assisted-by: AI --- tests/test_multiprocessing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_multiprocessing.py b/tests/test_multiprocessing.py index bfa5772..b0afe14 100644 --- a/tests/test_multiprocessing.py +++ b/tests/test_multiprocessing.py @@ -59,7 +59,7 @@ def test_queue(self): 6. The main process retrieves the correct value from queue `w` and matches it against expected result. """ def getxy(_q, _w): - _cfg = _q.get_nowait() + _cfg = _q.get(timeout=5) _w.put(_cfg.x.y) cfg = ini.INIConfig() cfg.x.y = '42'