diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2013-05-31 16:03:08 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2013-05-31 16:03:08 +1000 |
commit | 7668ad34f5a7b065b4ead8e535b0a62bdc8c0cf7 (patch) | |
tree | 80e9276f41cfd9f6ff32d96ec02a111ac07ac0c1 /test/format/backup.c | |
parent | 756d8c6422953b70e1463255418d491267733f72 (diff) | |
download | mongo-7668ad34f5a7b065b4ead8e535b0a62bdc8c0cf7.tar.gz |
Have test/format sleep for the calculated period between hot backups.
Diffstat (limited to 'test/format/backup.c')
-rw-r--r-- | test/format/backup.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/test/format/backup.c b/test/format/backup.c index a7e2d10b909..ea7c8bb9cdb 100644 --- a/test/format/backup.c +++ b/test/format/backup.c @@ -111,15 +111,14 @@ hot_backup(void *arg) * Perform a hot backup at somewhere under 10 seconds (so we get at * least one done), and then at 45 second intervals. */ - for (period = MMRAND(1, 10); !g.threads_finished; period = 45) { - - /* Sleep for a short period so we don't make the run wait. */ - if (period > 0) { + for (period = MMRAND(1, 10);; period = 45) { + /* Sleep for short periods so we don't make the run wait. */ + while (period > 0 && !g.threads_finished) { --period; sleep(1); - if (g.threads_finished) - break; } + if (g.threads_finished) + break; /* Lock out named checkpoints */ if ((ret = pthread_rwlock_wrlock(&g.backup_lock)) != 0) |