Skip to content

Commit 66d1705

Browse files
authored
fix: increase Atlas search index readiness timeout to 120s (PHPLARA-252) (#3542)
1 parent 179946c commit 66d1705

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

.github/workflows/build-ci-atlas.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,19 @@ jobs:
4242
- uses: actions/checkout@v6
4343

4444
- name: Create MongoDB Atlas Local
45+
timeout-minutes: 5
4546
run: |
4647
docker run --name mongodb -p 27017:27017 --detach mongodb/mongodb-atlas-local:latest
4748
until docker exec --tty mongodb mongosh --eval "db.runCommand({ ping: 1 })"; do
4849
sleep 1
4950
done
50-
until docker exec --tty mongodb mongosh --eval "db.createCollection('connection_test') && db.getCollection('connection_test').createSearchIndex({mappings:{dynamic: true}})"; do
51+
docker exec --tty mongodb mongosh --eval "db.createCollection('connection_test')"
52+
until docker exec --tty mongodb mongosh --eval "db.getCollection('connection_test').createSearchIndex({mappings:{dynamic: true}})"; do
53+
sleep 1
54+
done
55+
until docker exec --tty mongodb mongosh --eval "db.runCommand({ serverStatus: 1 })"; do
5156
sleep 1
5257
done
53-
54-
- name: Show MongoDB server status
55-
run: |
56-
docker exec --tty mongodb mongosh --eval "db.runCommand({ serverStatus: 1 })"
5758
5859
- name: Setup cache environment
5960
id: extcache

tests/AtlasSearchIndexManagement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ trait AtlasSearchIndexManagement
1818
*/
1919
public function waitForSearchIndexesDropped(Collection $collection)
2020
{
21-
$timeout = hrtime()[0] + 30;
21+
$timeout = hrtime()[0] + 120;
2222
// Waits for the search index created in the previous test to be deleted
2323
while ($collection->listSearchIndexes()->count()) {
2424
if (hrtime()[0] > $timeout) {
@@ -34,7 +34,7 @@ public function waitForSearchIndexesDropped(Collection $collection)
3434
*/
3535
public function waitForSearchIndexesReady(Collection $collection)
3636
{
37-
$timeout = hrtime()[0] + 30;
37+
$timeout = hrtime()[0] + 120;
3838
do {
3939
if (hrtime()[0] > $timeout) {
4040
throw new RuntimeException('Timed out waiting for search indexes to be ready');

0 commit comments

Comments
 (0)