summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-02-27 23:35:05 +0000
committerChris Wilson <chris+github@qwirx.com>2014-02-27 23:35:05 +0000
commit73f20fe6a2664d65aef1dd6f274ebc37760876f4 (patch)
treebffb3ab663dc055cfdc2dccbec1f91a0dd1df570 /lib
parentf211f55a3118d1a7213d26f8b54a3f37edbc1774 (diff)
Use the new test utilities to remove some duplicate code.
Fix previous changes by waiting for forked bbstored process during termination.
Diffstat (limited to 'lib')
-rw-r--r--lib/backupstore/StoreTestUtils.cpp4
-rw-r--r--lib/backupstore/StoreTestUtils.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/backupstore/StoreTestUtils.cpp b/lib/backupstore/StoreTestUtils.cpp
index 69af043b..99ebb9df 100644
--- a/lib/backupstore/StoreTestUtils.cpp
+++ b/lib/backupstore/StoreTestUtils.cpp
@@ -313,11 +313,11 @@ bool StartServer()
return true;
}
-bool StopServer()
+bool StopServer(bool wait_for_process)
{
TEST_THAT_THROWONFAIL(bbstored_pid != 0);
TEST_THAT_THROWONFAIL(ServerIsAlive(bbstored_pid));
- TEST_THAT_THROWONFAIL(KillServer(bbstored_pid));
+ TEST_THAT_THROWONFAIL(KillServer(bbstored_pid, wait_for_process));
::sleep(1);
TEST_THAT_THROWONFAIL(!ServerIsAlive(bbstored_pid));
diff --git a/lib/backupstore/StoreTestUtils.h b/lib/backupstore/StoreTestUtils.h
index ad4ff14c..d15404fa 100644
--- a/lib/backupstore/StoreTestUtils.h
+++ b/lib/backupstore/StoreTestUtils.h
@@ -67,7 +67,7 @@ bool check_reference_counts();
bool StartServer();
//! Stops the currently running bbstored test server.
-bool StopServer();
+bool StopServer(bool wait_for_process = false);
//! Creates the standard test account, for example after delete_account().
bool create_account(int soft, int hard);