From 277eb4016582c8eb89a1f8e983a444306fa4d14d Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Thu, 18 Jun 2026 21:54:54 -0400 Subject: [PATCH] fix(docker): close read txn before second begin in disk-usage test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test_disk_usage_persisted opened a second session.begin() after interleaved SELECTs, which autobegin a transaction → "A transaction is already begun". Roll back the read transaction before the re-report write. Restores the integration lane green for the /system/df slice (a840d6f). Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_016Jg27rgypiW2efULXJDtMC --- tests/integration/test_docker.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/integration/test_docker.py b/tests/integration/test_docker.py index 1c4af60..722e9ef 100644 --- a/tests/integration/test_docker.py +++ b/tests/integration/test_docker.py @@ -267,6 +267,8 @@ def test_disk_usage_persisted(app): "FROM docker_disk_usage WHERE host_id=:h"), {"h": hid})).first() img_count = (await s.execute(text( "SELECT COUNT(*) FROM docker_images WHERE host_id=:h"), {"h": hid})).scalar() + # End the autobegun read transaction before opening the next write one. + await s.rollback() # Re-report with one image dropped — the stale row must be pruned. async with s.begin(): await persist(s, await s.get(Host, hid), [], None, disk2)