fix(quartz): widen ExpirationTest insert window to dodge isExpired race
The pre-check in SQLiteEventStore.insertEvent rejects events whose expiration is <= TimeUtils.now(). With expiration = time + 1, the wall clock can tick past time + 1 between sampling `time` and the insert call, intermittently failing testDeletingExpiredEvents. https://claude.ai/code/session_01GoqXtcFnwgyjBict1EURyA
This commit is contained in:
+2
-2
@@ -50,7 +50,7 @@ class ExpirationTest : BaseDBTest() {
|
|||||||
val noteToExpire =
|
val noteToExpire =
|
||||||
signer.sign(
|
signer.sign(
|
||||||
TextNoteEvent.build("test1", createdAt = time + 1) {
|
TextNoteEvent.build("test1", createdAt = time + 1) {
|
||||||
expiration(time + 1)
|
expiration(time + 5)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ class ExpirationTest : BaseDBTest() {
|
|||||||
|
|
||||||
db.assertQuery(noteToExpire, Filter(ids = listOf(noteToExpire.id)))
|
db.assertQuery(noteToExpire, Filter(ids = listOf(noteToExpire.id)))
|
||||||
|
|
||||||
delay(2000)
|
delay(6000)
|
||||||
|
|
||||||
db.deleteExpiredEvents()
|
db.deleteExpiredEvents()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user