summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests
diff options
context:
space:
mode:
authorJonathan Reams <jbreams@mongodb.com>2018-04-18 13:34:16 -0400
committerAndrew Morrow <acm@mongodb.com>2018-05-23 10:44:50 -0400
commita03173c14410eeeeb8aa99a710509ce444bf7733 (patch)
tree76b148002d8ca5358c1e1d6663c20c4d19e04906 /src/mongo/dbtests
parent712e093c2ba468dff5554202f779a03b57a82fbc (diff)
downloadmongo-a03173c14410eeeeb8aa99a710509ce444bf7733.tar.gz
SERVER-34540 Remove sleeptest from dbtest
(cherry picked from commit dba852d5d9cd0b3f067fd8d880e7e576db580653)
Diffstat (limited to 'src/mongo/dbtests')
-rw-r--r--src/mongo/dbtests/basictests.cpp68
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>();