diff options
author | Louis Williams <louis.williams@mongodb.com> | 2021-02-08 13:12:10 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-02-08 21:42:06 +0000 |
commit | 29350aece6a2a0d55de8f63a1da97b2ae6c1294e (patch) | |
tree | 21f59926598c15c0ad1c964f915fbe3d83e3bf1b | |
parent | 6a5e743910ad6b2d9aea53aae046b2a0b63d3198 (diff) | |
download | mongo-29350aece6a2a0d55de8f63a1da97b2ae6c1294e.tar.gz |
SERVER-54144 Relax timing constraint in profile_operation_metrics.js
-rw-r--r-- | jstests/noPassthrough/profile_operation_metrics.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/jstests/noPassthrough/profile_operation_metrics.js b/jstests/noPassthrough/profile_operation_metrics.js index 7c3d41dc727..f50ab49de5d 100644 --- a/jstests/noPassthrough/profile_operation_metrics.js +++ b/jstests/noPassthrough/profile_operation_metrics.js @@ -34,11 +34,13 @@ const assertMetricsExist = (profilerEntry) => { assert.gte(metrics.docUnitsReturned, 0); assert.gte(metrics.cursorSeeks, 0); - // Every test should perform enough work to be measured as non-zero CPU activity in - // nanoseconds. + // Even though every test should perform enough work to be measured as non-zero CPU activity in + // nanoseconds, the OS is only required to return monotonically-increasing values. That means + // the OS may occasionally return the same CPU time between two different reads of the timer, + // resulting in the server calculating zero elapsed time. // The CPU time metrics are only collected on Linux. if (isLinux) { - assert.gt(metrics.cpuNanos, 0); + assert.gte(metrics.cpuNanos, 0); } assert.gte(metrics.docBytesWritten, 0); assert.gte(metrics.docUnitsWritten, 0); |