test(syslog): each integration step its own session (#5999)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -64,6 +64,7 @@ def test_an_unknown_sender_is_offered_and_an_added_one_kept(app):
|
||||
lines = (await s.execute(select(SyslogLine))).scalars().all()
|
||||
assert [(ln.app, ln.hostname, ln.message, ln.severity) for ln in lines] == [("kernel", "synnas", "kept", 3)]
|
||||
assert (await s.get(SyslogSource, src_id)).lines_total == 3
|
||||
async with app.db_sessionmaker() as s:
|
||||
async with s.begin():
|
||||
await s.execute(delete(SyslogSource))
|
||||
|
||||
@@ -102,6 +103,7 @@ def test_the_ring_keeps_each_source_within_its_window_and_cap(app):
|
||||
kept = (await s.execute(select(SyslogLine.source_id))).scalars().all()
|
||||
assert counts == {"age_pruned": 1, "size_pruned": 2}
|
||||
assert kept.count(a_id) == 3 and kept.count(b_id) == 2
|
||||
async with app.db_sessionmaker() as s:
|
||||
async with s.begin():
|
||||
await s.execute(delete(SyslogSource))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user