Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T2317 Verfied Wrong Replication Lag by Set values if RS is PSA - Mong… #664

Merged
merged 2 commits into from
Aug 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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");
},
);

Loading