summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/lock_stats.js
diff options
context:
space:
mode:
authorGeert Bosch <geert@mongodb.com>2019-05-04 13:58:06 -0400
committerGeert Bosch <geert@mongodb.com>2019-05-07 16:03:15 -0400
commitdd2ffef2662ab698c3bc25a57468fcf047e04cc0 (patch)
treeeab5680d2d7a9a401c326b05f52d4bfe24fde8d4 /jstests/noPassthrough/lock_stats.js
parentba844b4e81c3914b8a7017bd2a8c5ac4231c72ff (diff)
downloadmongo-dd2ffef2662ab698c3bc25a57468fcf047e04cc0.tar.gz
SERVER-41013 Make lock_stats.js test more resilient against unset stats
Diffstat (limited to 'jstests/noPassthrough/lock_stats.js')
-rw-r--r--jstests/noPassthrough/lock_stats.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/jstests/noPassthrough/lock_stats.js b/jstests/noPassthrough/lock_stats.js
index 08c60e9d9ca..85e6350ab0c 100644
--- a/jstests/noPassthrough/lock_stats.js
+++ b/jstests/noPassthrough/lock_stats.js
@@ -20,6 +20,8 @@
var stats = db.serverStatus().locks.Global;
if (!stats.acquireWaitCount || !stats.acquireWaitCount.W)
return false;
+ if (!stats.timeAcquiringMicros || !stats.timeAcquiringMicros.W)
+ return false;
if (!startStats.acquireWaitCount || !startStats.acquireWaitCount.W)
return true;
return stats.acquireWaitCount.W > startStats.acquireWaitCount.W;