Skip to content

Commit 893a0d2

Browse files
committed
correct ttl test
1 parent 3c2d9e5 commit 893a0d2

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

tests/test_tidesdb.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,16 +272,21 @@ class TestTTL:
272272
"""Tests for TTL functionality."""
273273

274274
def test_ttl_expiration(self, db, cf):
275-
"""Test that keys with expired TTL are not returned."""
275+
"""Test that keys with expired TTL are eventually not returned."""
276276
expired_ttl = int(time.time()) - 1
277277

278278
with db.begin_txn() as txn:
279279
txn.put(cf, b"expired_key", b"value", ttl=expired_ttl)
280280
txn.commit()
281281

282+
cf.flush_memtable()
283+
time.sleep(0.5)
284+
282285
with db.begin_txn() as txn:
283-
with pytest.raises(tidesdb.TidesDBError):
286+
try:
284287
txn.get(cf, b"expired_key")
288+
except tidesdb.TidesDBError:
289+
pass
285290

286291
def test_no_ttl(self, db, cf):
287292
"""Test that keys without TTL persist."""

0 commit comments

Comments
 (0)