Skip to content

Commit 258474c

Browse files
authored
Revert "test(NODE-6317): remove flaky unnecessary assertion (#4212)"
This reverts commit fb13ebf.
1 parent fb13ebf commit 258474c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/integration/server-discovery-and-monitoring/server_discover_and_monitoring.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,11 @@ describe('Monitoring rtt tests', function () {
109109
for (const [server, durations] of Object.entries(heartbeatDurations)) {
110110
const relevantDurations = durations.slice(IGNORE_SIZE);
111111
expect(relevantDurations).to.have.length.gt(0);
112+
const averageDuration =
113+
relevantDurations.reduce((acc, x) => acc + x) / relevantDurations.length;
112114
const rtt = client.topology.description.servers.get(server).roundTripTime;
113115
expect(rtt).to.not.equal(0);
116+
expect(rtt).to.be.approximately(averageDuration, 3);
114117
}
115118
}
116119
});

0 commit comments

Comments
 (0)