From 75f402c30259e06aee96c72e69a797915c8b1fba Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 26 Aug 2026 18:56:08 -0700 Subject: [PATCH] test(ci): assert cookie DB at either location + dump Default contents on miss [do-not-merge] Auto-close live test asserted the legacy Default/Cookies path, but modern Chrome writes Default/Network/Cookies. Accept either; on miss, print the copy's Default listing so a real copy gap (vs a path-assertion bug) is visible. --- tests/hermes_cli/test_real_profile_windows_live.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/hermes_cli/test_real_profile_windows_live.py b/tests/hermes_cli/test_real_profile_windows_live.py index 53623f5398..d30656e3f8 100644 --- a/tests/hermes_cli/test_real_profile_windows_live.py +++ b/tests/hermes_cli/test_real_profile_windows_live.py @@ -122,8 +122,18 @@ def test_autoclose_on_closes_chrome_and_snapshots(tmp_path): assert err is None, f"auto-close snapshot failed: {err}" assert dst is not None - copy_ck = Path(dst) / "Default" / "Cookies" - assert copy_ck.is_file(), "cookie DB not copied after auto-close" + # Cookie DB may be at the modern Network/ location or the legacy path, + # depending on the Chrome build — accept either, but it MUST exist and + # be a valid SQLite cookies DB. + candidates = [ + Path(dst) / "Default" / "Network" / "Cookies", + Path(dst) / "Default" / "Cookies", + ] + copy_ck = next((c for c in candidates if c.is_file()), None) + assert copy_ck is not None, ( + "cookie DB not copied after auto-close; Default contents: " + + repr(sorted(os.listdir(Path(dst) / "Default")) if (Path(dst) / "Default").is_dir() else "NO Default") + ) # Valid SQLite with the cookies table. con = sqlite3.connect(str(copy_ck)) try: