@@ -259,7 +259,7 @@ public async Task SimpleHashInsertWhenAsync()
259
259
res = await collection . InsertAsync ( obj , WhenKey . NotExists , TimeSpan . FromMilliseconds ( 5000 ) ) ;
260
260
Assert . Null ( res ) ;
261
261
var expiration = ( long ) await connection . ExecuteAsync ( "PTTL" , key ) ;
262
- Assert . True ( expiration < 4000 , $ "Expiration is { expiration } ") ;
262
+ Assert . True ( expiration < 4050 , $ "Expiration is { expiration } ") ;
263
263
res = await collection . InsertAsync ( obj , WhenKey . Exists , TimeSpan . FromMilliseconds ( 5000 ) ) ;
264
264
Assert . NotNull ( res ) ;
265
265
@@ -303,7 +303,7 @@ public void SimpleHashInsertWhen()
303
303
res = collection . Insert ( obj , WhenKey . NotExists , TimeSpan . FromMilliseconds ( 5000 ) ) ;
304
304
Assert . Null ( res ) ;
305
305
var expiration = ( long ) connection . Execute ( "PTTL" , key ) ;
306
- Assert . True ( expiration < 4000 ) ;
306
+ Assert . True ( expiration <= 4050 ) ;
307
307
res = collection . Insert ( obj , WhenKey . Exists , TimeSpan . FromMilliseconds ( 5000 ) ) ;
308
308
Assert . NotNull ( res ) ;
309
309
@@ -348,15 +348,15 @@ public async Task SimpleJsonInsertWhenAsync()
348
348
res = await collection . InsertAsync ( obj , WhenKey . NotExists , TimeSpan . FromMilliseconds ( 5000 ) ) ;
349
349
Assert . Null ( res ) ;
350
350
var expiration = ( long ) await connection . ExecuteAsync ( "PTTL" , key ) ;
351
- Assert . True ( expiration < 4000 ) ;
351
+ Assert . True ( expiration <= 4050 , $ "Actual: { expiration } " ) ;
352
352
res = await collection . InsertAsync ( obj , WhenKey . Exists , TimeSpan . FromMilliseconds ( 5000 ) ) ;
353
353
expiration = ( long ) await connection . ExecuteAsync ( "PTTL" , key ) ;
354
354
Assert . NotNull ( res ) ;
355
- Assert . True ( expiration > 4000 ) ;
355
+ Assert . True ( expiration >= 4000 , $ "Actual: { expiration } " ) ;
356
356
res = collection . Insert ( obj , WhenKey . Always , TimeSpan . FromMilliseconds ( 6000 ) ) ;
357
357
expiration = ( long ) connection . Execute ( "PTTL" , key ) ;
358
358
Assert . NotNull ( res ) ;
359
- Assert . True ( expiration > 5000 ) ;
359
+ Assert . True ( expiration >= 5000 ) ;
360
360
res = collection . Insert ( obj , WhenKey . Always ) ;
361
361
expiration = ( long ) connection . Execute ( "PTTL" , key ) ;
362
362
Assert . NotNull ( res ) ;
@@ -396,7 +396,7 @@ public void SimpleJsonInsertWhen()
396
396
res = collection . Insert ( obj , WhenKey . NotExists , TimeSpan . FromMilliseconds ( 5000 ) ) ;
397
397
Assert . Null ( res ) ;
398
398
var expiration = ( long ) connection . Execute ( "PTTL" , key ) ;
399
- Assert . True ( expiration < 4000 , $ "Expiration: { expiration } ") ;
399
+ Assert . True ( expiration <= 4050 , $ "Expiration: { expiration } ") ;
400
400
res = collection . Insert ( obj , WhenKey . Exists , TimeSpan . FromMilliseconds ( 5000 ) ) ;
401
401
Assert . NotNull ( res ) ;
402
402
res = collection . Insert ( obj , WhenKey . Always , TimeSpan . FromMilliseconds ( 6000 ) ) ;
0 commit comments