test: model token flushes in the persistence race fixture

This commit is contained in:
Teknium
2026-09-07 05:18:55 -07:00
parent f9523c20e7
commit ed3b9920ad
+5
View File
@@ -126,8 +126,12 @@ def test_direct_session_db_flushes_share_marker_claim(agent):
self.entered = threading.Event()
self.release = threading.Event()
self.calls = 0
self.token_flushes = 0
self._lock = threading.Lock()
def flush_token_counts(self):
self.token_flushes += 1
def append_message(self, **kwargs):
with self._lock:
self.calls += 1
@@ -178,6 +182,7 @@ def test_direct_session_db_flushes_share_marker_claim(agent):
assert not normal.is_alive()
assert not direct.is_alive()
assert db.rows == ["exactly once"]
assert db.token_flushes == 1
def test_malformed_memory_config_still_builds_default_store():