From 2da9f0bdc150551833ead4e820981763fdc9da72 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Sat, 12 Sep 2026 22:39:04 -0700 Subject: [PATCH] test(plugin_storage): journal-mode assertion follows the shared WAL fallback verdict The old test pinned 'wal' unconditionally. Now that plugin_db routes through apply_wal_with_fallback, a WAL-reset-vulnerable SQLite build (the CI runner) correctly lands on DELETE; assert the contract, not the runner's build. --- tests/test_plugin_storage.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_plugin_storage.py b/tests/test_plugin_storage.py index 28f2ded8cf..a774c3d884 100644 --- a/tests/test_plugin_storage.py +++ b/tests/test_plugin_storage.py @@ -43,7 +43,11 @@ def test_hostile_names_are_rejected(hermes_home, bad): plugin_data_dir(bad) -def test_plugin_db_opens_wal_sqlite_in_the_data_dir(hermes_home): +def test_plugin_db_journal_mode_is_the_shared_fallback_verdict(hermes_home): + """Plugin DBs take the journal mode the core WAL helper decides for this SQLite build and + filesystem (WAL normally; DELETE on WAL-reset-bug builds or network FS) — never a raw PRAGMA.""" + from hermes_state_wal import is_sqlite_wal_reset_vulnerable + conn = plugin_db("board") try: conn.execute("CREATE TABLE t (x)") @@ -51,7 +55,7 @@ def test_plugin_db_opens_wal_sqlite_in_the_data_dir(hermes_home): conn.commit() mode = conn.execute("PRAGMA journal_mode").fetchone()[0] - assert mode == "wal" + assert mode == ("delete" if is_sqlite_wal_reset_vulnerable() else "wal") finally: conn.close()