회기 연속성과 멀티 케이스 계약을 영속화
This commit is contained in:
parent
be08c0b573
commit
72353ecd82
26 changed files with 2170 additions and 127 deletions
|
|
@ -693,6 +693,12 @@ class SessionMemoryPersistenceTest(unittest.IsolatedAsyncioTestCase):
|
|||
self.executed.append((query, args))
|
||||
return "OK"
|
||||
|
||||
async def fetchval(self, query: str, *args: object) -> object:
|
||||
self.executed.append((query, args))
|
||||
test_case.assertIn("FROM app.case_profile", query)
|
||||
test_case.assertIn("FOR NO KEY UPDATE", query)
|
||||
return args[0]
|
||||
|
||||
async def fetchrow(self, query: str, *args: object):
|
||||
self.executed.append((query, args))
|
||||
if "INSERT INTO app.pinned_fact" in query:
|
||||
|
|
@ -773,6 +779,17 @@ class SessionMemoryPersistenceTest(unittest.IsolatedAsyncioTestCase):
|
|||
persisted = await session_persistence.end_session(sess, carry)
|
||||
|
||||
self.assertTrue(persisted)
|
||||
case_lock_index = next(
|
||||
index
|
||||
for index, (query, _) in enumerate(conn.executed)
|
||||
if "SELECT case_id" in query and "FOR NO KEY UPDATE" in query
|
||||
)
|
||||
session_end_index = next(
|
||||
index
|
||||
for index, (query, _) in enumerate(conn.executed)
|
||||
if "UPDATE app.sessions" in query and "ended_at" in query
|
||||
)
|
||||
self.assertLess(case_lock_index, session_end_index)
|
||||
summary_writes = [
|
||||
args for query, args in conn.executed if "INSERT INTO app.session_summary" in query
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue