From 1a85412f968268f8db138fa391dbda8dafbb375c Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Fri, 2 Aug 2024 16:26:06 +0200 Subject: [PATCH] test/sstable: simplify check_summary_func() under async() The lambda passed to write_and_validate_sst() already runs in seastar::thread context; replace future::then() chaining with future::get() calls. We're going to eliminate the trailing "return make_ready_future<>()" later. This patch is best viewed with "git show -W -b". Signed-off-by: Laszlo Ersek --- test/boost/sstable_test.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/boost/sstable_test.cc b/test/boost/sstable_test.cc index 8627a506f0..3272e6bae0 100644 --- a/test/boost/sstable_test.cc +++ b/test/boost/sstable_test.cc @@ -211,17 +211,17 @@ write_and_validate_sst(schema_ptr s, sstring dir, noncopyable_function SEASTAR_TEST_CASE(check_summary_func) { auto s = make_schema_for_compressed_sstable(); return write_and_validate_sst(std::move(s), "test/resource/sstables/compressed", [] (shared_sstable sst1, shared_sstable sst2) { - return sstables::test(sst2).read_summary().then([sst1, sst2] { - summary& sst1_s = sstables::test(sst1).get_summary(); - summary& sst2_s = sstables::test(sst2).get_summary(); + sstables::test(sst2).read_summary().get(); - BOOST_REQUIRE(::memcmp(&sst1_s.header, &sst2_s.header, sizeof(summary::header)) == 0); - BOOST_REQUIRE(sst1_s.positions == sst2_s.positions); - BOOST_REQUIRE(sst1_s.entries == sst2_s.entries); - BOOST_REQUIRE(sst1_s.first_key.value == sst2_s.first_key.value); - BOOST_REQUIRE(sst1_s.last_key.value == sst2_s.last_key.value); - return make_ready_future<>(); - }); + summary& sst1_s = sstables::test(sst1).get_summary(); + summary& sst2_s = sstables::test(sst2).get_summary(); + + BOOST_REQUIRE(::memcmp(&sst1_s.header, &sst2_s.header, sizeof(summary::header)) == 0); + BOOST_REQUIRE(sst1_s.positions == sst2_s.positions); + BOOST_REQUIRE(sst1_s.entries == sst2_s.entries); + BOOST_REQUIRE(sst1_s.first_key.value == sst2_s.first_key.value); + BOOST_REQUIRE(sst1_s.last_key.value == sst2_s.last_key.value); + return make_ready_future<>(); }); }