Skip to content

Commit 9e131fd

Browse files
committed
test(deploy): relentlessly retry getSearchIndexes
1 parent 5226513 commit 9e131fd

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

.github/workflows/tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- narrow-deploy-500
78
issue_comment:
89
types: [created]
910

@@ -22,7 +23,7 @@ jobs:
2223
strategy:
2324
fail-fast: false
2425
matrix:
25-
couchbase-server-version: [ 'enterprise-7.6.1', 'enterprise-7.6.2', 'enterprise-7.6.3', 'enterprise-7.6.4' ]
26+
couchbase-server-version: [ 'enterprise-7.6.4' ]
2627
services:
2728
couchbase:
2829
image: couchbase:${{ matrix.couchbase-server-version }}
@@ -111,7 +112,7 @@ jobs:
111112
112113
- name: Upload Couchbase Logs
113114
if: failure() && steps.cb-logs.conclusion == 'success'
114-
uses: actions/upload-artifact@v3
115+
uses: actions/upload-artifact@v4
115116
with:
116117
name: couchbase-logs-${{ github.sha }}-${{ github.run_id }}
117118
path: couchbase-logs-${{ github.sha }}-${{ github.run_id }}.tar.gz

packages/deploy/src/clusterChanges/applyCouchbaseClusterChanges.ts

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -645,18 +645,27 @@ async function applyUpsertSearchIndex(
645645
scopeName: change.scope,
646646
});
647647

648-
const searchIndexes = await cluster
649-
.bucket(change.bucket)
650-
.scope(change.scope)
651-
.searchIndexes()
652-
.getAllIndexes({ timeout: 15_000 });
653-
654-
const searchIndex = searchIndexes.find((s) => s.name === change.name);
655-
656-
if (searchIndex) {
657-
config.uuid = searchIndex.uuid;
658-
config.sourceUUID = searchIndex.sourceUuid;
659-
}
648+
await retry(
649+
async () => {
650+
const searchIndexes = await cluster
651+
.bucket(change.bucket)
652+
.scope(change.scope)
653+
.searchIndexes()
654+
.getAllIndexes();
655+
656+
const searchIndex = searchIndexes.find((s) => s.name === change.name);
657+
658+
if (searchIndex) {
659+
config.uuid = searchIndex.uuid;
660+
config.sourceUUID = searchIndex.sourceUuid;
661+
}
662+
},
663+
{
664+
delay: 1_000,
665+
retries: 'INFINITELY',
666+
timeout: opts.timeout,
667+
}
668+
);
660669

661670
console.log(
662671
`${getTimePrefix()} Requesting creation of search index "${change.bucket} # ${change.name}"`

tests/deploy/tests/applyCouchbaseClusterChanges.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ describe.runIf(
128128
);
129129

130130
await applyCouchbaseClusterChanges(cluster, getApiConfig(false), changes, {
131-
timeout: 45_000,
131+
timeout: 180_000,
132132
});
133133

134134
// Check keyspaces //

0 commit comments

Comments
 (0)