From ee203f846ed3753cd8031ae6a6ee4e333875aada Mon Sep 17 00:00:00 2001 From: "Raphael S. Carvalho" Date: Fri, 15 Dec 2023 15:04:44 -0300 Subject: [PATCH] test: Fix segfault when running offstrategy test Observer, that references table_for_test, must of course, not outlive table_for_test. Observer can be called later after the last input sstable is removed from sstable manager. Signed-off-by: Raphael S. Carvalho Closes scylladb/scylladb#16428 --- test/boost/sstable_compaction_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/boost/sstable_compaction_test.cc b/test/boost/sstable_compaction_test.cc index f63e4aec6c..20f26fe306 100644 --- a/test/boost/sstable_compaction_test.cc +++ b/test/boost/sstable_compaction_test.cc @@ -5074,8 +5074,8 @@ static future<> run_incremental_compaction_test(sstables::offstrategy offstrateg } size_t last_input_sstable_count = sstables_nr; + auto t = env.make_table_for_tests(s); { - auto t = env.make_table_for_tests(s); auto& cm = t->get_compaction_manager(); auto stop = deferred_stop(t); t->disable_auto_compaction().get();