From 6ca58b3badd0677be4be265e47b23f15a0198043 Mon Sep 17 00:00:00 2001 From: Jonathan Reams Date: Wed, 18 Apr 2018 13:34:16 -0400 Subject: SERVER-34540 Remove sleeptest from dbtest (cherry picked from commit dba852d5d9cd0b3f067fd8d880e7e576db580653) --- src/mongo/dbtests/basictests.cpp | 68 ---------------------------------------- 1 file changed, 68 deletions(-) diff --git a/src/mongo/dbtests/basictests.cpp b/src/mongo/dbtests/basictests.cpp index 9734c1d8aab..5ea9cc152b1 100644 --- a/src/mongo/dbtests/basictests.cpp +++ b/src/mongo/dbtests/basictests.cpp @@ -217,73 +217,6 @@ public: }; } -class sleeptest { -public: - void run() { - Timer t; - int matches = 0; - for (int p = 0; p < 3; p++) { - sleepsecs(1); - int sec = (t.millis() + 2) / 1000; - if (sec == 1) - matches++; - else - mongo::unittest::log() << "temp millis: " << t.millis() << endl; - ASSERT(sec >= 0 && sec <= 2); - t.reset(); - } - if (matches < 2) - mongo::unittest::log() << "matches:" << matches << endl; - ASSERT(matches >= 2); - - sleepmicros(1527123); - ASSERT(t.micros() > 1000000); - ASSERT(t.micros() < 2000000); - - t.reset(); - sleepmillis(1727); - ASSERT(t.millis() >= 1000); - ASSERT(t.millis() <= 2500); - - { - int total = 1200; - int ms = 2; - t.reset(); - for (int i = 0; i < (total / ms); i++) { - sleepmillis(ms); - } - { - int x = t.millis(); - if (x < 1000 || x > 2500) { - cout << "sleeptest finds sleep accuracy to be not great. x: " << x << endl; - ASSERT(x >= 1000); - ASSERT(x <= 20000); - } - } - } - -#ifdef __linux__ - { - int total = 1200; - int micros = 100; - t.reset(); - int numSleeps = 1000 * (total / micros); - for (int i = 0; i < numSleeps; i++) { - sleepmicros(micros); - } - { - int y = t.millis(); - if (y < 1000 || y > 2500) { - cout << "sleeptest y: " << y << endl; - ASSERT(y >= 1000); - /* ASSERT( y <= 100000 ); */ - } - } - } -#endif - } -}; - class SleepBackoffTest { public: void run() { @@ -494,7 +427,6 @@ public: add(); add(); - add(); add(); add(); -- cgit v1.2.1