From b41cda4fe697dce6fd9b83b3805362ccc02fbeb3 Mon Sep 17 00:00:00 2001 From: Vishnu K Date: Tue, 10 Sep 2024 15:55:35 -0400 Subject: SERVER-93575 make cursor_server_status_metrics_lifespan_histogram.js less flaky [v8.0] (#26524) GitOrigin-RevId: d7cd03b239ac39a3c7d63f7145e91aca36f93db6 --- ...sor_server_status_metrics_lifespan_histogram.js | 27 ---------------------- 1 file changed, 27 deletions(-) diff --git a/jstests/noPassthroughWithMongod/cursor_server_status_metrics_lifespan_histogram.js b/jstests/noPassthroughWithMongod/cursor_server_status_metrics_lifespan_histogram.js index d42df06c8d8..6139e2b683e 100644 --- a/jstests/noPassthroughWithMongod/cursor_server_status_metrics_lifespan_histogram.js +++ b/jstests/noPassthroughWithMongod/cursor_server_status_metrics_lifespan_histogram.js @@ -20,14 +20,6 @@ function getNumCursorsLessThan30Seconds() { return db.serverStatus().metrics.cursor.lifespan.lessThan30Seconds; } -function getNumCursorsLessThan1Minute() { - return db.serverStatus().metrics.cursor.lifespan.lessThan1Minute; -} - -function getNumCursorsLessThan10Minutes() { - return db.serverStatus().metrics.cursor.lifespan.lessThan10Minutes; -} - for (let i = 0; i < 40; i++) { coll.insert({a: i, b: "field b"}); } @@ -36,8 +28,6 @@ const initialNumCursorsLt1s = getNumCursorsLessThan1Second(); const initialNumCursorsLt5s = getNumCursorsLessThan5Seconds(); const initialNumCursorsLt15s = getNumCursorsLessThan15Seconds(); const initialNumCursorsLt30s = getNumCursorsLessThan30Seconds(); -const initialNumCursorsLt1m = getNumCursorsLessThan1Minute(); -const initialNumCursorsLt10m = getNumCursorsLessThan10Minutes(); // Since we aren't guaranteed perfect timings, the checks in this test have been relaxed to window // sizes of 30s. For example, a cursor that is expected to die in under 5s may actually take longer @@ -63,20 +53,3 @@ for (let i = 0; i < 3; i++) { } assert.eq(cursorsDeadSinceStartLt30Seconds(), 4); - -const cursorLt1Minute = coll.find().batchSize(2); -const cursorLt10Minutes = coll.aggregate([], {cursor: {batchSize: 2}}); -cursorLt1Minute.next(); -cursorLt10Minutes.next(); - -sleep(31000); // Sleep for 31 s. -while (cursorLt1Minute.hasNext()) { - cursorLt1Minute.next(); -} -assert.eq(getNumCursorsLessThan1Minute() - initialNumCursorsLt1m, 1); - -sleep(30000); // Sleep another 30s, so the total should be greater than 1m and less than 10m. -while (cursorLt10Minutes.hasNext()) { - cursorLt10Minutes.next(); -} -assert.eq(getNumCursorsLessThan10Minutes() - initialNumCursorsLt10m, 1); \ No newline at end of file -- cgit v1.2.3