diff options
author | Jonathan Reams <jbreams@mongodb.com> | 2018-04-18 13:34:16 -0400 |
---|---|---|
committer | Jonathan Reams <jbreams@mongodb.com> | 2018-04-23 13:02:00 -0400 |
commit | dba852d5d9cd0b3f067fd8d880e7e576db580653 (patch) | |
tree | 052062ebf86e404b033e33f1e39dde1e8f6b6845 /src | |
parent | 5b40332d8d5cebdf47c43694bc5b9911841bde81 (diff) | |
download | mongo-dba852d5d9cd0b3f067fd8d880e7e576db580653.tar.gz |
SERVER-34540 Remove sleeptest from dbtest
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/dbtests/basictests.cpp | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/src/mongo/dbtests/basictests.cpp b/src/mongo/dbtests/basictests.cpp index aa48562cf93..541d2c776ba 100644 --- a/src/mongo/dbtests/basictests.cpp +++ b/src/mongo/dbtests/basictests.cpp @@ -215,73 +215,6 @@ public: }; } // namespace stringbuildertests -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() { @@ -492,7 +425,6 @@ public: add<stringbuildertests::reset1>(); add<stringbuildertests::reset2>(); - add<sleeptest>(); add<SleepBackoffTest>(); add<AssertTests>(); |