Skip to content

Commit a9384b1

Browse files
committed
check with completed count
1 parent 98a635c commit a9384b1

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/NRedisStack.Tests/Search/SearchTests.cs

+4-5
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
using System.Runtime.InteropServices;
99
using NetTopologySuite.IO;
1010
using NetTopologySuite.Geometries;
11-
using System.Linq.Expressions;
12-
using System.Collections;
13-
1411

1512
namespace NRedisStack.Tests.Search;
1613

@@ -3451,6 +3448,7 @@ public async void TestDocumentLoadWithDB_Issue352(string endpointId)
34513448

34523449
Document droppedDocument = null;
34533450
int numberOfAttempts = 0;
3451+
Int32 completed = 0;
34543452

34553453
do
34563454
{
@@ -3474,6 +3472,7 @@ public async void TestDocumentLoadWithDB_Issue352(string endpointId)
34743472
// doc would show up in search result with no fields
34753473
if (docs.Count == 0)
34763474
{
3475+
Interlocked.Increment(ref completed);
34773476
break;
34783477
}
34793478
// 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)
34823481
else if (docs[0].GetProperties().Count() == 0)
34833482
{
34843483
droppedDocument = docs[0];
3484+
Interlocked.Increment(ref completed);
34853485
break;
34863486
}
34873487
}
@@ -3495,8 +3495,7 @@ public async void TestDocumentLoadWithDB_Issue352(string endpointId)
34953495
}
34963496
Task checkTask = Task.WhenAll(tasks);
34973497
await Task.WhenAny(checkTask, Task.Delay(1500));
3498-
Assert.True(checkTask.IsCompleted);
3499-
Assert.Null(checkTask.Exception);
3498+
Assert.Equal(3, completed);
35003499
cancelled = true;
35013500
} while (droppedDocument == null && numberOfAttempts++ < 5);
35023501
// we wont do an actual assert here since

0 commit comments

Comments
 (0)