From 92df36985dc098e4390d3ac4b607adabb3d1df24 Mon Sep 17 00:00:00 2001 From: Jay Zhuang Date: Mon, 19 Sep 2022 14:10:05 -0700 Subject: [PATCH] Deflake CompactionServiceTest.BasicCompactions (#10697) Summary: The background compaction may still running while the test end, which would cause ASAN stack-use-after-scope error. Explicitly close the DB before test end. Pull Request resolved: https://github.com/facebook/rocksdb/pull/10697 Test Plan: able to reproduce with: ``` gtest-parallel ./compaction_service_test --gtest_filter=CompactionServiceTest.BasicCompactions -r 10000 -w 100 ``` Reviewed By: gitbw95 Differential Revision: D39590974 Pulled By: jay-zhuang fbshipit-source-id: da264b2e6a276afbda7d5ff7adb9d7b8d4213d90 --- db/compaction/compaction_service_test.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/db/compaction/compaction_service_test.cc b/db/compaction/compaction_service_test.cc index 3bb487b6a..c475c4e3b 100644 --- a/db/compaction/compaction_service_test.cc +++ b/db/compaction/compaction_service_test.cc @@ -325,6 +325,7 @@ TEST_F(CompactionServiceTest, BasicCompactions) { }); Reopen(options); ASSERT_GT(verify_passed, 0); + Close(); } TEST_F(CompactionServiceTest, ManualCompaction) {