From 4621a2d699daeaa92efb93dae9db076308cbe823 Mon Sep 17 00:00:00 2001 From: Kshitij Kapoor <82637225+kshitijk4poor@users.noreply.github.com> Date: Sun, 23 Aug 2026 13:28:02 +0530 Subject: [PATCH] test: drop vacuous identity assertions from marker sync guard (#92231 review) CPython interns identifier-like string literals, so 'is' cannot distinguish an import alias from a copy-pasted literal (verified: two exec'd namespaces each defining the literal share one object). The equality assertions three lines above are the full honest guard. Also reword a comment: raw == is marker-SENSITIVE, not asymmetric. --- tests/agent/test_load_time_durability_stamp_92231.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/agent/test_load_time_durability_stamp_92231.py b/tests/agent/test_load_time_durability_stamp_92231.py index e5f65dd06f..7bad8923b3 100644 --- a/tests/agent/test_load_time_durability_stamp_92231.py +++ b/tests/agent/test_load_time_durability_stamp_92231.py @@ -73,10 +73,6 @@ def test_marker_constant_in_sync() -> None: assert _DB_PERSISTED_MARKER_KEY == run_agent._DB_PERSISTED_MARKER assert _DB_PERSISTED_MARKER_KEY == cc._DB_PERSISTED_MARKER assert _DB_PERSISTED_MARKER_KEY == tf._DB_PERSISTED_MARKER - # The import aliases must be the SAME object as the canonical constant, - # not re-defined literals. - assert _DB_PERSISTED_MARKER_KEY is cc._DB_PERSISTED_MARKER - assert tf._DB_PERSISTED_MARKER is cc._DB_PERSISTED_MARKER def test_loaded_rows_are_stamped_durable(tmp_path: Path) -> None: @@ -181,7 +177,7 @@ def test_noop_progress_check_is_marker_insensitive(tmp_path: Path) -> None: {k: v for k, v in m.items() if k != _DB_PERSISTED_MARKER_KEY} for m in stamped ] - assert swept != stamped # raw equality is asymmetric — the bug shape + assert swept != stamped # raw == is marker-sensitive — the bug shape assert _strip_marker_for_comparison(swept) == _strip_marker_for_comparison( stamped )