Skip to content

Commit 73109c1

Browse files
committed
test/objectstore: Make test idempotent
Give it a new DB name for each test so we don't get failures on rerun. Signed-off-by: Paulo E. Castro <[email protected]>
1 parent 64539ed commit 73109c1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/test/objectstore/test_deferred.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// vim: ts=8 sw=2 smarttab
33

44
#include <stdio.h>
5+
#include <stdlib.h>
56
#include <string.h>
67
#include <iostream>
78
#include <memory>
@@ -44,10 +45,11 @@ void create_deferred_and_terminate() {
4445
coll_t cid;
4546
ghobject_t hoid;
4647
ObjectStore::CollectionHandle ch;
47-
ceph_assert(::mkdir("bluestore.test_temp_dir", 0777) == 0);
48+
std::string const db_store_dir = "bluestore.test_temp_dir_" + std::to_string(time(NULL));
49+
ceph_assert(::mkdir(db_store_dir.c_str(), 0777) == 0);
4850
store = ObjectStore::create(g_ceph_context,
4951
"bluestore",
50-
"bluestore.test_temp_dir",
52+
db_store_dir.c_str(),
5153
"store_test_temp_journal");
5254
ceph_assert(store->mkfs() == 0);
5355
ceph_assert(store->mount() == 0);

0 commit comments

Comments
 (0)