diff --git a/tests/fstream_test.cc b/tests/fstream_test.cc index 644027d36ad..b11d80ed97a 100644 --- a/tests/fstream_test.cc +++ b/tests/fstream_test.cc @@ -33,6 +33,7 @@ #include "util/defer.hh" #include #include +#include struct writer { output_stream out; @@ -262,17 +263,19 @@ SEASTAR_TEST_CASE(file_handle_test) { buf[i] = i; } f.dma_write(0, buf, 4096).get(); - smp::invoke_on_all([fh = f.dup()] { - return seastar::async([fh] { + auto bad = std::vector(smp::count); // std::vector is special and unsuitable because it uses bitfields + smp::invoke_on_all([fh = f.dup(), &bad] { + return seastar::async([fh, &bad] { auto f = fh.to_file(); auto buf = static_cast(aligned_alloc(4096, 4096)); auto del = defer([&] { ::free(buf); }); f.dma_read(0, buf, 4096).get(); for (unsigned i = 0; i < 4096; ++i) { - BOOST_REQUIRE_EQUAL(buf[i], char(i)); + bad[engine().cpu_id()] |= buf[i] != char(i); } }); }).get(); + BOOST_REQUIRE(!boost::algorithm::any_of_equal(bad, 1u)); f.close().get(); }); }