diff --git a/tests/HDF5WritingTest.cpp b/tests/HDF5WritingTest.cpp index bc18fc1a3..23e9fabb7 100644 --- a/tests/HDF5WritingTest.cpp +++ b/tests/HDF5WritingTest.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "../common/DiffractionExperiment.h" #include "../writer/HDF5Objects.h" @@ -573,6 +574,10 @@ TEST_CASE("HDF5Writer_Socket", "[HDF5][Full]") { s.SubscribeAll(); s.ReceiveTimeout(std::chrono::seconds(5)); + // PUB drops what it sends before the subscription has reached it, and the first file is closed + // (and announced) right after the second image - ensure sub socket is properly connected + std::this_thread::sleep_for(std::chrono::seconds(2)); + for (int i = 0; i < x.GetImageNum(); i++) { DataMessage message{}; message.image = CompressedImage(image, x.GetXPixelsNum(), x.GetYPixelsNum());