Skip to content

Commit 2192ad9

Browse files
Effi-SAkramBitar
authored andcommitted
Widen Flaky test gap
Signed-off-by: Effi-S <effi.szt@gmail.com>
1 parent 255b225 commit 2192ad9

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

token/services/storage/db/dbtest/tokens.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,17 +1398,20 @@ func TGetDeletedTokensPendingSKICleanup(t *testing.T, db TestTokenDB) {
13981398

13991399
// Test 5: Time filtering - only tokens older than duration
14001400
t.Run("TimeFiltering", func(t *testing.T) {
1401+
const gap = 1 * time.Second
1402+
const duration = 500 * time.Millisecond
1403+
14011404
// Create an old token
14021405
createAndDeleteToken("old_token", 0, "idemix")
14031406

1404-
// Wait a bit to ensure time difference
1405-
time.Sleep(100 * time.Millisecond)
1407+
// Wait long enough that old_token is comfortably older than `duration`.
1408+
time.Sleep(gap)
14061409

14071410
// Create a recent token
14081411
createAndDeleteToken("recent_token", 0, "idemix")
14091412

14101413
// Query with duration that should exclude the recent token
1411-
tokens, err := db.GetDeletedTokensPendingSKICleanup(ctx, 50*time.Millisecond, 100)
1414+
tokens, err := db.GetDeletedTokensPendingSKICleanup(ctx, duration, 100)
14121415
require.NoError(t, err, "query should not error")
14131416

14141417
// Verify old token is in results

0 commit comments

Comments
 (0)