From ec07cbee62ff9b9ba4e12bdc5ce60bf0bda74d91 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Sat, 3 Oct 2026 15:53:19 +0530 Subject: [PATCH] test(connectors): assert only on _DeadlockError in the import race test Gate finding BN21 r1 2c (Medium, flaky): the race snippet's own purge() pops tools.connectors* from sys.modules while sibling threads are mid-import, so importlib also raises AttributeError ('NoneType' object has no attribute '__dict__') for tools.connectors.tool. That is a harness artifact, not the deadlock, yet the old `!= "KeyError"` filter kept it and the fixed tree went red intermittently (8/160 runs under 8x parallel load). Filter on the bug class itself. Measured: HEAD 30/30 green serial and 160/160 under the same load; BASE tools/connectors/__init__.py 30/30 red (_DeadlockError in every run). --- tests/tools/test_connectors_import_deadlock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tools/test_connectors_import_deadlock.py b/tests/tools/test_connectors_import_deadlock.py index 2d05618316..d1631adcc9 100644 --- a/tests/tools/test_connectors_import_deadlock.py +++ b/tests/tools/test_connectors_import_deadlock.py @@ -52,7 +52,7 @@ for t in threads: for t in threads: t.join(timeout=120) print("alive", sum(1 for t in threads if t.is_alive())) -print("errors", [e for e in errors if e[1] != "KeyError"]) +print("errors", [e for e in errors if e[1] == "_DeadlockError"]) """