@@ -83,23 +83,20 @@ describe('Monitoring rtt tests', function () {
83
83
await promise ;
84
84
} ) ;
85
85
86
- it (
87
- 'heartbeat duration is not incorrectly reported as zero on ServerHeartbeatSucceededEvents' ,
88
- {
89
- metadata : {
90
- requires : { topology : '!load-balanced' }
91
- } ,
92
- test : async function ( ) {
93
- for ( const durations of Object . values ( heartbeatDurations ) ) {
94
- const relevantDurations = durations . slice ( IGNORE_SIZE ) ;
95
- expect ( relevantDurations ) . to . have . length . gt ( 0 ) ;
96
- const averageDuration =
97
- relevantDurations . reduce ( ( acc , x ) => acc + x ) / relevantDurations . length ;
98
- expect ( averageDuration ) . to . be . gt ( DELAY_MS ) ;
99
- }
86
+ it ( 'ServerHeartbeatSucceededEvent.duration is greater than or equal to the actual rtt' , {
87
+ metadata : {
88
+ requires : { topology : '!load-balanced' }
89
+ } ,
90
+ test : async function ( ) {
91
+ for ( const durations of Object . values ( heartbeatDurations ) ) {
92
+ const relevantDurations = durations . slice ( IGNORE_SIZE ) ;
93
+ expect ( relevantDurations ) . to . have . length . gt ( 0 ) ;
94
+ const averageDuration =
95
+ relevantDurations . reduce ( ( acc , x ) => acc + x ) / relevantDurations . length ;
96
+ expect ( averageDuration ) . to . be . gte ( DELAY_MS ) ;
100
97
}
101
98
}
102
- ) ;
99
+ } ) ;
103
100
104
101
it ( 'ServerDescription.roundTripTime is not incorrectly reported as zero' , {
105
102
metadata : {
@@ -114,6 +111,18 @@ describe('Monitoring rtt tests', function () {
114
111
}
115
112
}
116
113
} ) ;
114
+
115
+ it ( 'ServerDescription.roundTripTime is greater than or equal to the actual rtt' , {
116
+ metadata : {
117
+ requires : { topology : '!load-balanced' }
118
+ } ,
119
+ test : async function ( ) {
120
+ for ( const server of Object . keys ( heartbeatDurations ) ) {
121
+ const rtt = client . topology . description . servers . get ( server ) . roundTripTime ;
122
+ expect ( rtt ) . to . be . gte ( DELAY_MS ) ;
123
+ }
124
+ }
125
+ } ) ;
117
126
} ) ;
118
127
} ) ;
119
128
}
0 commit comments