8
8
using System . Runtime . InteropServices ;
9
9
using NetTopologySuite . IO ;
10
10
using NetTopologySuite . Geometries ;
11
- using System . Linq . Expressions ;
12
- using System . Collections ;
13
-
14
11
15
12
namespace NRedisStack . Tests . Search ;
16
13
@@ -3451,6 +3448,7 @@ public async void TestDocumentLoadWithDB_Issue352(string endpointId)
3451
3448
3452
3449
Document droppedDocument = null ;
3453
3450
int numberOfAttempts = 0 ;
3451
+ Int32 completed = 0 ;
3454
3452
3455
3453
do
3456
3454
{
@@ -3474,6 +3472,7 @@ public async void TestDocumentLoadWithDB_Issue352(string endpointId)
3474
3472
// doc would show up in search result with no fields
3475
3473
if ( docs . Count == 0 )
3476
3474
{
3475
+ Interlocked . Increment ( ref completed ) ;
3477
3476
break ;
3478
3477
}
3479
3478
// if we get a document with no fields then we know that the key
@@ -3482,6 +3481,7 @@ public async void TestDocumentLoadWithDB_Issue352(string endpointId)
3482
3481
else if ( docs [ 0 ] . GetProperties ( ) . Count ( ) == 0 )
3483
3482
{
3484
3483
droppedDocument = docs [ 0 ] ;
3484
+ Interlocked . Increment ( ref completed ) ;
3485
3485
break ;
3486
3486
}
3487
3487
}
@@ -3495,8 +3495,7 @@ public async void TestDocumentLoadWithDB_Issue352(string endpointId)
3495
3495
}
3496
3496
Task checkTask = Task . WhenAll ( tasks ) ;
3497
3497
await Task . WhenAny ( checkTask , Task . Delay ( 1500 ) ) ;
3498
- Assert . True ( checkTask . IsCompleted ) ;
3499
- Assert . Null ( checkTask . Exception ) ;
3498
+ Assert . Equal ( 3 , completed ) ;
3500
3499
cancelled = true ;
3501
3500
} while ( droppedDocument == null && numberOfAttempts ++ < 5 ) ;
3502
3501
// we wont do an actual assert here since
0 commit comments