Skip to content

Commit

Permalink
T2317 Verfied Wrong Replication Lag by Set values if RS is PSA - Mong…
Browse files Browse the repository at this point in the history
…oDB Cluster Summary (#664)
  • Loading branch information
saikumar-vs authored Aug 3, 2023
1 parent d66ba14 commit b29742e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/qa-integration/pmm_psmdb_integration_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Before(async ({ I, settingsAPI }) => {
const version = process.env.PSMDB_VERSION ? `${process.env.PSMDB_VERSION}` : '4.4';
const replica_container_name = `psmdb_pmm_${version}_replica`;
const regular_container_name = `psmdb_pmm_${version}_regular`;
const arbiter_container_name = `psmdb_pmm_${version}_arbiter`;
const remoteServiceName = 'remote_pmm-psmdb-integration';

const connection = {
Expand Down Expand Up @@ -171,3 +172,28 @@ Scenario(
I.assertEqual(numberOfVisibleElements,1 , "No of ARBITER elements for ReplicatSet are not as expected");
},
);

Scenario(
'T2317 Verify Wrong Replication Lag by Set values if RS is PSA -( MongoDB Cluster Summary) @pmm-psmdb-arbiter-integration @not-ui-pipeline',
async ({
I, dashboardPage, adminPage,
}) => {

I.amOnPage(`${dashboardPage.mongodbReplicaSetSummaryDashboard.url}&var-replset=rs1`);
dashboardPage.waitForDashboardOpened();

// Grab secs or year lag value from Replication Lag min field in UI
const replLagLocator = '(//a[@data-testid=\'data-testid dashboard-row-title-Replication Lag\']/following::a[contains(text(),\'mongodb_rs2_1\')]/following::td[contains(text(),\' s\') or contains(text(),\' year\')])[1]';

// Get the text content of the element located
const replLagText = await I.grabTextFrom(replLagLocator);
// Grab only Lag value required from Text
let actualLagValue= +replLagText.split(".",1);
// Grab actual Lag value required from database
let expectedLagValue = (await I.verifyCommand(`docker exec -w /mongosh/bin/ ${arbiter_container_name} ./mongosh --eval rs\.printSecondaryReplicationInfo\\(\\) | awk '/replLag:/ {print $2}' | cut -c 2`)).trim();
// Give some threshold increase for actual replication lag, for now 2 secs extra
expectedLagValue = +expectedLagValue+2;
I.assertBelow(actualLagValue,expectedLagValue, "ReplicaLag is more than expected lag vaule");
},
);

0 comments on commit b29742e

Please sign in to comment.