diff options
author | Susan LoVerso <sue@mongodb.com> | 2016-03-07 17:15:35 -0500 |
---|---|---|
committer | Susan LoVerso <sue@mongodb.com> | 2016-03-07 17:15:35 -0500 |
commit | 83b7117b10cd290d5271b873d3fb2612934f7805 (patch) | |
tree | e9b9bf06b0e1fc2fae53dc1e5aa2f0a3da4b49b4 /test/manydbs | |
parent | d5fbb1d0bc052b106612c54e37e31c171a23d79b (diff) | |
download | mongo-83b7117b10cd290d5271b873d3fb2612934f7805.tar.gz |
WT-2318 Add loop to check CPU for 30 seconds.
Diffstat (limited to 'test/manydbs')
-rw-r--r-- | test/manydbs/manydbs.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/test/manydbs/manydbs.c b/test/manydbs/manydbs.c index 16dcec5e078..2d6baa89a86 100644 --- a/test/manydbs/manydbs.c +++ b/test/manydbs/manydbs.c @@ -119,15 +119,17 @@ main(int argc, char *argv[]) sleep(10); (void)snprintf(cmd, sizeof(cmd), "ps -p %lu -o pcpu=", (unsigned long)getpid()); - if ((fp = popen(cmd, "r")) == NULL) - testutil_die(errno, "popen"); - fscanf(fp, "%f", &cpu); - if (cpu > max) { - fprintf(stderr, "CPU usage: %f, max %f\n", cpu, max); - testutil_die(ERANGE, "CPU Usage"); + for (i = 0; i < 30; i += 5) { + if ((fp = popen(cmd, "r")) == NULL) + testutil_die(errno, "popen"); + fscanf(fp, "%f", &cpu); + if (cpu > max) { + fprintf(stderr, "CPU usage: %f, max %f\n", cpu, max); + testutil_die(ERANGE, "CPU Usage"); + } + if (pclose(fp) != 0) + testutil_die(errno, "pclose"); } - if (pclose(fp) != 0) - testutil_die(errno, "pclose"); for (i = 0; i < dbs; ++i) testutil_check(conn[i]->close(conn[i], NULL)); |