88using System . Runtime . InteropServices ;
99using NetTopologySuite . IO ;
1010using NetTopologySuite . Geometries ;
11- using System . Linq . Expressions ;
12- using System . Collections ;
13-
1411
1512namespace NRedisStack . Tests . Search ;
1613
@@ -3456,6 +3453,8 @@ public async void TestDocumentLoadWithDB_Issue352(string endpointId)
34563453 {
34573454 // try until succesfully create the key and set the TTL
34583455 bool ttlRefreshed = false ;
3456+ Int32 completed = 0 ;
3457+
34593458 do
34603459 {
34613460 db . HashSet ( "student:1111" , new HashEntry [ ] { new ( "first" , "Joe" ) , new ( "last" , "Dod" ) , new ( "age" , 18 ) } ) ;
@@ -3474,6 +3473,7 @@ public async void TestDocumentLoadWithDB_Issue352(string endpointId)
34743473 // doc would show up in search result with no fields
34753474 if ( docs . Count == 0 )
34763475 {
3476+ Interlocked . Increment ( ref completed ) ;
34773477 break ;
34783478 }
34793479 // if we get a document with no fields then we know that the key
@@ -3482,6 +3482,7 @@ public async void TestDocumentLoadWithDB_Issue352(string endpointId)
34823482 else if ( docs [ 0 ] . GetProperties ( ) . Count ( ) == 0 )
34833483 {
34843484 droppedDocument = docs [ 0 ] ;
3485+ Interlocked . Increment ( ref completed ) ;
34853486 break ;
34863487 }
34873488 }
@@ -3495,8 +3496,7 @@ public async void TestDocumentLoadWithDB_Issue352(string endpointId)
34953496 }
34963497 Task checkTask = Task . WhenAll ( tasks ) ;
34973498 await Task . WhenAny ( checkTask , Task . Delay ( 1500 ) ) ;
3498- Assert . True ( checkTask . IsCompleted ) ;
3499- Assert . Null ( checkTask . Exception ) ;
3499+ Assert . Equal ( 3 , completed ) ;
35003500 cancelled = true ;
35013501 } while ( droppedDocument == null && numberOfAttempts ++ < 5 ) ;
35023502 // we wont do an actual assert here since
0 commit comments