From b4a773f3380b7fa23c8d4341c8429c1c7c95690a Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Thu, 14 Nov 2024 18:14:28 +0100 Subject: [PATCH] test(core): Fix other search e2e tests --- packages/core/e2e/default-search-plugin-uuids.e2e-spec.ts | 4 ++++ .../e2e/elasticsearch-plugin-uuid.e2e-spec.ts | 3 +++ .../elasticsearch-plugin/e2e/elasticsearch-plugin.e2e-spec.ts | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/core/e2e/default-search-plugin-uuids.e2e-spec.ts b/packages/core/e2e/default-search-plugin-uuids.e2e-spec.ts index 37c1749668..c14e215946 100644 --- a/packages/core/e2e/default-search-plugin-uuids.e2e-spec.ts +++ b/packages/core/e2e/default-search-plugin-uuids.e2e-spec.ts @@ -50,6 +50,10 @@ describe('Default search plugin with UUIDs', () => { // rebuild is not completed in time for the first test. await new Promise(resolve => setTimeout(resolve, 5000)); + // We have extra time here because a lot of jobs are + // triggered from all the product updates + await awaitRunningJobs(adminClient, 10_000, 1000); + const { facets } = await adminClient.query( GET_FACET_LIST, { diff --git a/packages/elasticsearch-plugin/e2e/elasticsearch-plugin-uuid.e2e-spec.ts b/packages/elasticsearch-plugin/e2e/elasticsearch-plugin-uuid.e2e-spec.ts index 1100017b97..046670b4d3 100644 --- a/packages/elasticsearch-plugin/e2e/elasticsearch-plugin-uuid.e2e-spec.ts +++ b/packages/elasticsearch-plugin/e2e/elasticsearch-plugin-uuid.e2e-spec.ts @@ -43,6 +43,9 @@ describe('Elasticsearch plugin with UuidIdStrategy', () => { customerCount: 1, }); await adminClient.asSuperAdmin(); + // We have extra time here because a lot of jobs are + // triggered from all the product updates + await awaitRunningJobs(adminClient, 10_000, 1000); await adminClient.query(REINDEX); await awaitRunningJobs(adminClient); }, TEST_SETUP_TIMEOUT_MS); diff --git a/packages/elasticsearch-plugin/e2e/elasticsearch-plugin.e2e-spec.ts b/packages/elasticsearch-plugin/e2e/elasticsearch-plugin.e2e-spec.ts index 9a3560704b..24502cc6a8 100644 --- a/packages/elasticsearch-plugin/e2e/elasticsearch-plugin.e2e-spec.ts +++ b/packages/elasticsearch-plugin/e2e/elasticsearch-plugin.e2e-spec.ts @@ -188,7 +188,9 @@ describe('Elasticsearch plugin', () => { customerCount: 1, }); await adminClient.asSuperAdmin(); - await awaitRunningJobs(adminClient); + // We have extra time here because a lot of jobs are + // triggered from all the product updates + await awaitRunningJobs(adminClient, 10_000, 1000); await adminClient.query(REINDEX); await awaitRunningJobs(adminClient); }, TEST_SETUP_TIMEOUT_MS);