Skip to content

Commit 36924ef

Browse files
authored
Merge pull request ceph#59200 from ifed01/wip-ifed-fix-store-test-col-ref
test/store_test: fix assertions due to unclosed collection refs. Reviewd-by: Pere Diaz Bou <[email protected]>
2 parents 41a768a + a66b9df commit 36924ef

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/test/objectstore/store_test.cc

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10216,12 +10216,14 @@ TEST_P(StoreTestSpecificAUSize, BluestoreBrokenZombieRepairTest) {
1021610216
}
1021710217

1021810218
cerr << "fscking/fixing" << std::endl;
10219+
for (size_t i = 0; i < col_count; i++) {
10220+
ch[i].reset(nullptr);
10221+
}
1021910222
bstore->umount();
1022010223
ASSERT_EQ(bstore->fsck(false), col_count * obj_count);
1022110224
ASSERT_LE(bstore->quick_fix(), 0);
1022210225
ASSERT_EQ(bstore->fsck(false), 0);
1022310226
}
10224-
1022510227
cerr << "Completing" << std::endl;
1022610228
bstore->mount();
1022710229
}
@@ -10279,6 +10281,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreRepairSharedBlobTest) {
1027910281
r = queue_transaction(store, ch, std::move(t));
1028010282
ASSERT_EQ(r, 0);
1028110283
}
10284+
ch.reset(nullptr);
1028210285
bstore->umount();
1028310286
bstore->mount();
1028410287
{
@@ -10367,6 +10370,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreBrokenNoSharedBlobRepairTest) {
1036710370
bstore->inject_stray_shared_blob_key(12345678);
1036810371

1036910372
{
10373+
ch.reset(nullptr);
1037010374
cerr << "fscking/fixing" << std::endl;
1037110375
// we need to check for null-manager before umount()
1037210376
bool has_null_manager = bstore->has_null_manager();
@@ -10439,6 +10443,7 @@ TEST_P(StoreTest, BluestoreRepairGlobalStats) {
1043910443
ASSERT_EQ(r, 0);
1044010444
}
1044110445

10446+
ch.reset(nullptr);
1044210447
bstore->umount();
1044310448

1044410449
// enable per-pool stats collection hence causing fsck to fail
@@ -10501,6 +10506,7 @@ TEST_P(StoreTest, BluestoreRepairGlobalStatsFixOnMount) {
1050110506
ASSERT_EQ(r, 0);
1050210507
}
1050310508

10509+
ch.reset(nullptr);
1050410510
bstore->umount();
1050510511

1050610512
// enable per-pool stats collection hence causing fsck to fail
@@ -10748,6 +10754,7 @@ TEST_P(StoreTestDeferredSetup, DISABLED_BluestoreHugeReads)
1074810754
}
1074910755

1075010756
// force cache clear
10757+
ch.reset(nullptr);
1075110758
{
1075210759
EXPECT_EQ(store->umount(), 0);
1075310760
EXPECT_EQ(store->mount(), 0);
@@ -11240,6 +11247,7 @@ TEST_P(MultiLabelTest, UpgradeToMultiLabelCollisionWithObjects) {
1124011247
}
1124111248
}
1124211249
}
11250+
ch.reset(nullptr);
1124311251
umount();
1124411252
// Need to do 2 passes of repair:
1124511253
// - the first one moves offending objects away
@@ -11670,6 +11678,7 @@ TEST_P(StoreTestSpecificAUSize, Ticket45195Repro) {
1167011678
r = store->read(ch, hoid, 0xb000, 0xb000, bl);
1167111679
ASSERT_EQ(r, 0xb000);
1167211680

11681+
ch.reset(nullptr);
1167311682
store->umount();
1167411683
store->mount();
1167511684

@@ -11734,6 +11743,7 @@ TEST_P(StoreTestOmapUpgrade, WithOmapHeader) {
1173411743
ASSERT_EQ(res.size(), 1);
1173511744
ASSERT_EQ(res.begin()->first, "key1");
1173611745
}
11746+
ch.reset(nullptr);
1173711747
store->umount();
1173811748
ASSERT_EQ(store->fsck(false), 0);
1173911749
SetVal(g_conf(), "bluestore_debug_legacy_omap", "false");
@@ -11838,6 +11848,7 @@ TEST_P(StoreTestOmapUpgrade, NoOmapHeader) {
1183811848
ASSERT_EQ(res.size(), 1);
1183911849
ASSERT_EQ(res.begin()->first, "key1");
1184011850
}
11851+
ch.reset(nullptr);
1184111852
store->umount();
1184211853
ASSERT_EQ(store->fsck(false), 0);
1184311854
SetVal(g_conf(), "bluestore_debug_legacy_omap", "false");
@@ -11896,6 +11907,7 @@ TEST_P(StoreTestOmapUpgrade, LargeLegacyToPG) {
1189611907
//checking just written data
1189711908
check_omap_data(object_count, poolid, cid);
1189811909

11910+
ch.reset(nullptr);
1189911911
store->umount();
1190011912
ASSERT_EQ(store->fsck(false), 0);
1190111913
SetVal(g_conf(), "bluestore_debug_legacy_omap", "false");

0 commit comments

Comments
 (0)