diff --git a/test/boost/address_map_test.cc b/test/boost/address_map_test.cc index a1f98334b1..d0a74b5d3e 100644 --- a/test/boost/address_map_test.cc +++ b/test/boost/address_map_test.cc @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include @@ -290,12 +290,17 @@ SEASTAR_THREAD_TEST_CASE(test_address_map_replication) { m.set_expiring(id1); BOOST_CHECK(m.find(id1) && *m.find(id1) == addr1); m.barrier().get(); + promise<> shard0_timer_expired; + timer shard0_timer([&shard0_timer_expired] { + shard0_timer_expired.set_value(); + }); + shard0_timer.arm(manual_clock::now() + expiration_time); m_svc.invoke_on(1, [] (address_map_t& m) { BOOST_CHECK(m.find(id1) && *m.find(id1) == addr1); manual_clock::advance(expiration_time); BOOST_CHECK(!m.find(id1)); - return smp::submit_to(0, []{}); // Ensure shard 0 notices timer is expired. }).get(); + shard0_timer_expired.get_future().get(); BOOST_CHECK(!m.find(id1)); // Expiring entries are replicated