summaryrefslogtreecommitdiff
path: root/test/backupstorepatch
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2016-09-16 20:56:32 +0100
committerChris Wilson <chris+github@qwirx.com>2016-09-16 20:56:32 +0100
commit519a2a37c575777c1301c64b489fdf95e5a97f69 (patch)
tree3b01d38123b965ef5b1a27532a14919f30c464bd /test/backupstorepatch
parent480783187d95cc5cce18e0a9737a588328a5d18b (diff)
Speed up testbackupstorepatch on Windows.
Detect when housekeeping has run and account is unlocked, and stop the loop early, so that we don't have to wait for 32 iterations of the loop.
Diffstat (limited to 'test/backupstorepatch')
-rw-r--r--test/backupstorepatch/testbackupstorepatch.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/test/backupstorepatch/testbackupstorepatch.cpp b/test/backupstorepatch/testbackupstorepatch.cpp
index e149a041..46f278ad 100644
--- a/test/backupstorepatch/testbackupstorepatch.cpp
+++ b/test/backupstorepatch/testbackupstorepatch.cpp
@@ -610,10 +610,13 @@ int test(int argc, const char *argv[])
writedir.Commit(true);
}
+ // Get the revision number of the root directory, before housekeeping makes any changes.
+ int64_t first_revision = 0;
+ RaidFileRead::FileExists(0, "backup/01234567/o01", &first_revision);
+
#ifdef WIN32
- // Cannot signal bbstored to do housekeeping now,
- // so just wait until we're sure it's done
- wait_for_operation(12, "housekeeping to run");
+ // Cannot signal bbstored to do housekeeping now, and we don't need to, as we will
+ // wait up to 32 seconds and detect automatically when it has finished.
#else
// Send the server a restart signal, so it does
// housekeeping immediately, and wait for it to happen
@@ -622,10 +625,8 @@ int test(int argc, const char *argv[])
::kill(pid, SIGHUP);
#endif
- // Get the revision number of the info file
- int64_t first_revision = 0;
- RaidFileRead::FileExists(0, "backup/01234567/o01", &first_revision);
- for(int l = 0; l < 32; ++l)
+ // Wait for changes to be written back to the root directory.
+ for(int secs_remaining = 32; secs_remaining >= 0; secs_remaining--)
{
// Sleep a while, and print a dot
::sleep(1);
@@ -633,7 +634,7 @@ int test(int argc, const char *argv[])
::fflush(stdout);
// Early end?
- if(l > 2)
+ if(!TestFileExists("testfiles/0_0/backup/01234567/write.lock"))
{
int64_t revid = 0;
RaidFileRead::FileExists(0, "backup/01234567/o01", &revid);
@@ -642,6 +643,8 @@ int test(int argc, const char *argv[])
break;
}
}
+
+ TEST_LINE(secs_remaining != 0, "No changes detected to root directory after 32 seconds");
}
::printf("\n");