Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -83,23 +83,20 @@ describe('Monitoring rtt tests', function () {
await promise;
});

it(
'heartbeat duration is not incorrectly reported as zero on ServerHeartbeatSucceededEvents',
{
metadata: {
requires: { topology: '!load-balanced' }
},
test: async function () {
for (const durations of Object.values(heartbeatDurations)) {
const relevantDurations = durations.slice(IGNORE_SIZE);
expect(relevantDurations).to.have.length.gt(0);
const averageDuration =
relevantDurations.reduce((acc, x) => acc + x) / relevantDurations.length;
expect(averageDuration).to.be.gt(DELAY_MS);
}
it('ServerHeartbeatSucceededEvent.duration is greater than or equal to the actual rtt', {
metadata: {
requires: { topology: '!load-balanced' }
},
test: async function () {
for (const durations of Object.values(heartbeatDurations)) {
const relevantDurations = durations.slice(IGNORE_SIZE);
expect(relevantDurations).to.have.length.gt(0);
const averageDuration =
relevantDurations.reduce((acc, x) => acc + x) / relevantDurations.length;
expect(averageDuration).to.be.gte(DELAY_MS);
}
}
);
});

it('ServerDescription.roundTripTime is not incorrectly reported as zero', {
metadata: {
Expand All @@ -114,6 +111,18 @@ describe('Monitoring rtt tests', function () {
}
}
});

it('ServerDescription.roundTripTime is greater than or equal to the actual rtt', {
metadata: {
requires: { topology: '!load-balanced' }
},
test: async function () {
for (const server of Object.keys(heartbeatDurations)) {
const rtt = client.topology.description.servers.get(server).roundTripTime;
expect(rtt).to.be.gte(DELAY_MS);
}
}
});
});
});
}
Expand Down