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 <raphaelsc@scylladb.com>

Closes scylladb/scylladb#16428
This commit is contained in:
Raphael S. Carvalho
2023-12-15 15:04:44 -03:00
committed by Avi Kivity
parent 9af6c7e40b
commit ee203f846e

View File

@@ -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();