Skip to content

The agent that grows with you

test(install-e2e): a lock file keeps main's {"kind": "lock"} record on the volatile path

Teknium0f2fdc2757f7
diff --git a/tests/install/e2e-assets/verify-user-state.py b/tests/install/e2e-assets/verify-user-state.py
index 55a36b906fd..65526db239f 100644
--- a/tests/install/e2e-assets/verify-user-state.py
+++ b/tests/install/e2e-assets/verify-user-state.py
@@ -287,7 +287,9 @@ def _entry_record_unless_vanished(rel: str, abs_path: str) -> dict | None:
if _volatile_sidecar(rel) and not _is_link(abs_path):
if not _lexists(abs_path):
return None
- return {"kind": "dir" if os.path.isdir(abs_path) else "file"}
+ if os.path.isdir(abs_path):
+ return {"kind": "dir"}
+ return {"kind": "lock"} if abs_path.endswith(".lock") else {"kind": "file"}
return _entry_record(abs_path)
except FileNotFoundError:
if _volatile_sidecar(rel):
diff --git a/tests/scripts/test_verify_user_state.py b/tests/scripts/test_verify_user_state.py
index 47a703d6894..af9e6a8437c 100644
--- a/tests/scripts/test_verify_user_state.py
+++ b/tests/scripts/test_verify_user_state.py
@@ -482,7 +482,7 @@ def test_a_held_lock_file_is_recorded_without_reading_it(tmp_path, monkeypatch):
monkeypatch.setattr(vus, "_sha256_file", locked)
snap = vus.snapshot_home(str(home))
- assert snap["entries"]["profiles/p/gateway.lock"] == {"kind": "file"}
+ assert snap["entries"]["profiles/p/gateway.lock"] == {"kind": "lock"}
os.remove(home / "profiles" / "p" / "gateway.lock")
report = vus.verify_home(str(home), snap)
assert report["ok"] is True and report["tolerated_deleted"] == ["profiles/p/gateway.lock"]