File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -63,14 +63,14 @@ public function testIndexLifecycle(): void
63
63
$ this ->assertSame ($ name , $ createdName );
64
64
65
65
// Wait for the index to be ready
66
- $ count = 0 ;
66
+ $ maxWaitingTime = 90 ;
67
67
do {
68
68
sleep (1 );
69
69
$ result = $ collection ->listSearchIndexes ($ name );
70
70
$ this ->assertInstanceOf (CachingIterator::class, $ result );
71
71
$ index = $ result ->current ();
72
72
73
- if ($ count ++ > 90 ) {
73
+ if ($ maxWaitingTime -- <= 0 ) {
74
74
$ this ->fail ('Search index did not become queryable ' );
75
75
}
76
76
} while (! $ index ->queryable );
@@ -84,16 +84,16 @@ public function testIndexLifecycle(): void
84
84
$ collection ->dropSearchIndex ($ name );
85
85
86
86
// Wait for the index to be deleted
87
- $ count = 0 ;
87
+ $ maxWaitingTime = 90 ;
88
88
do {
89
89
sleep (1 );
90
90
$ result = $ collection ->listSearchIndexes ($ name );
91
91
$ this ->assertInstanceOf (CachingIterator::class, $ result );
92
92
93
- if ($ count ++ > 90 ) {
93
+ if ($ maxWaitingTime -- <= 0 ) {
94
94
$ this ->fail ('Search index was not deleted ' );
95
95
}
96
- } while ($ result ->valid () );
96
+ } while ($ result ->count () !== 0 );
97
97
}
98
98
99
99
/**
You can’t perform that action at this time.
0 commit comments