diff --git a/src/v/kafka/server/tests/topic_recreate_test.cc b/src/v/kafka/server/tests/topic_recreate_test.cc index c5c253489acca..1da64428648e3 100644 --- a/src/v/kafka/server/tests/topic_recreate_test.cc +++ b/src/v/kafka/server/tests/topic_recreate_test.cc @@ -122,18 +122,6 @@ class recreate_test_fixture : public redpanda_thread_fixture { }); }); } - - void restart() { - shutdown(); - app_signal = std::make_unique<::stop_signal>(); - ss::smp::invoke_on_all([] { - auto& config = config::shard_local_cfg(); - config.get("disable_metrics").set_value(false); - }).get(); - app.initialize(proxy_config(), proxy_client_config()); - app.check_environment(); - app.wire_up_and_start(*app_signal, true); - } }; FIXTURE_TEST(test_topic_recreation, recreate_test_fixture) { @@ -184,10 +172,11 @@ FIXTURE_TEST(test_topic_recreation_recovery, recreate_test_fixture) { test_tp, kafka::error_code::unknown_topic_or_partition) .get(); info("Restarting redpanda, first time"); - restart(); + restart(should_wipe::no); wait_for_controller_leadership().get(); info("Creating {} with {} partitions", test_tp, 3); create_topic(test_tp(), 3, 1); + wait_until_topic_status(test_tp, kafka::error_code::none).get(); info("Deleting {}", test_tp); delete_topics({test_tp}); wait_until_topic_status( @@ -197,7 +186,7 @@ FIXTURE_TEST(test_topic_recreation_recovery, recreate_test_fixture) { create_topic(test_tp(), 3, 1); wait_until_topic_status(test_tp, kafka::error_code::none).get(); info("Restarting redpanda, second time"); - restart(); + restart(should_wipe::no); info("Waiting for recovery"); wait_for_controller_leadership().get(); wait_until_topic_status(test_tp, kafka::error_code::none).get(); @@ -272,7 +261,7 @@ FIXTURE_TEST(test_recreated_topic_does_not_lose_data, recreate_test_fixture) { }) .get(); info("Restarting redpanda"); - restart(); + restart(should_wipe::no); // make sure we can read the same amount of data { diff --git a/src/v/redpanda/tests/fixture.h b/src/v/redpanda/tests/fixture.h index d450894a23f3b..92b6813f262c3 100644 --- a/src/v/redpanda/tests/fixture.h +++ b/src/v/redpanda/tests/fixture.h @@ -280,6 +280,9 @@ class redpanda_thread_fixture { app.initialize(proxy_config(), proxy_client_config()); app.check_environment(); app.wire_up_and_start(*app_signal, true); + app.controller->get_partition_leaders() + .invoke_on_all([](cluster::partition_leaders_table& t) { t.reset(); }) + .get(); } config::configuration& lconf() { return config::shard_local_cfg(); }