From 1435ce6b50a06d091d841f7a470e6e22f73f44e4 Mon Sep 17 00:00:00 2001 From: rahulsjha <132360698+rahulsjha@users.noreply.github.com> Date: Sat, 21 Nov 2026 22:30:46 +0530 Subject: [PATCH] Postgres redaction tests publish a key's first write before rewriting it A key's first memory.set answers at its Postgres commit, before its flush. test_a_redact_reaches_a_revision_by_its_metadata, test_a_redaction_fences_the_claim_still_sending_the_old_text and test_a_fenced_holder_is_waited_out_after_its_delivery_moves_on each wrote the key a second time straight after, then waited once for the org's deliveries. The first two timed out at that wait in CI on 13-17 November ("the org's deliveries published"); the server log of run 43412144069 shows the two writes 0.3 s apart, then the 15 s wait running out. Each test now waits for the first write's publication before the second, as #790 did for the other tests in this file, so the second write never overtakes an unpublished first one. No timeout, assertion or production behavior changes. Refs #640 Signed-off-by: rahulsjha <132360698+rahulsjha@users.noreply.github.com> --- tests/integration/test_pg_authority.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/integration/test_pg_authority.py b/tests/integration/test_pg_authority.py index fdae7ce954..d91db5cbad 100644 --- a/tests/integration/test_pg_authority.py +++ b/tests/integration/test_pg_authority.py @@ -775,6 +775,8 @@ async def test_a_redact_reaches_a_revision_by_its_metadata( whose payload is cleared through its columns, which it then marks.""" ns = f"pg-{uuid.uuid4().hex[:8]}" first = (await call("memory.set", _set(ns, "k", "the token is hunter2"))).json() + # Publish the initial head before the next write can supersede it. + await _published(pg_conn, org) assert (await call("memory.set", _set(ns, "k", "the token was rotated"))).status_code == 200 await _published(pg_conn, org) at = "WHERE org = $1 AND namespace = $2 AND version = $3" @@ -2834,6 +2836,8 @@ async def test_a_redaction_fences_the_claim_still_sending_the_old_text( ns = f"pg-{uuid.uuid4().hex[:8]}" first = (await call("memory.set", _set(ns, "k", "the token is hunter2"))).json() + # Publish the initial head before the next write can supersede it. + await _published(pg_conn, org) assert (await call("memory.set", _set(ns, "k", "the token was rotated"))).status_code == 200 await _published(pg_conn, org) seq = await pg_conn.fetchval( @@ -3901,6 +3905,8 @@ async def test_a_fenced_holder_is_waited_out_after_its_delivery_moves_on( ns = f"pg-{uuid.uuid4().hex[:8]}" first = (await call("memory.set", _set(ns, "k", "the token is hunter2"))).json() + # Publish the initial head before the next write can supersede it. + await _published(pg_conn, org) assert (await call("memory.set", _set(ns, "k", "the token was rotated"))).status_code == 200 await _published(pg_conn, org) seq = await pg_conn.fetchval(