Skip to content

Commit f763fa9

Browse files
authored
Fix OSD CI group2 tests (#1784)
Signed-off-by: Suchit Sahoo <[email protected]>
1 parent 8a58446 commit f763fa9

File tree

2 files changed

+10
-0
lines changed
  • cypress

2 files changed

+10
-0
lines changed

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/data.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ describe('table visualization data', () => {
3030
cy.deleteIndex(TABLE_INDEX_ID);
3131
cy.deleteIndexPattern(TABLE_INDEX_PATTERN);
3232
cy.bulkUploadDocs(TABLE_PATH_INDEX_DATA);
33+
cy.forceMergeSegments();
3334
cy.importSavedObjects(TABLE_PATH_SO_DATA);
3435
// Load table visualization
3536
cy.visit(`${BASE_PATH}/app/visualize`);

cypress/utils/commands.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,15 @@ Cypress.Commands.add('bulkUploadDocs', (fixturePath, index) => {
372372
});
373373
});
374374

375+
// Adding this command to force merge all segments and remove results inconsistency due to concurrent searches
376+
// Refer https://github.com/opensearch-project/OpenSearch/issues/18149 for more details
377+
Cypress.Commands.add('forceMergeSegments', () => {
378+
cy.request({
379+
method: 'POST',
380+
url: `${Cypress.env('openSearchUrl')}/_forcemerge?max_num_segments=1`,
381+
});
382+
});
383+
375384
Cypress.Commands.add('importSavedObjects', (fixturePath, overwrite = true) => {
376385
const sendImportRequest = (ndjson) => {
377386
const url = `${Cypress.config().baseUrl}/api/saved_objects/_import?${

0 commit comments

Comments
 (0)