From c01685f38d2563a66080850799fb9120b74e3c07 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 3 Nov 2024 15:12:21 +0100 Subject: [PATCH] Try to fix flaky tests --- unit_tests/library/extract.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/unit_tests/library/extract.cpp b/unit_tests/library/extract.cpp index 342d672f7cd..9a1446169a4 100644 --- a/unit_tests/library/extract.cpp +++ b/unit_tests/library/extract.cpp @@ -6,6 +6,7 @@ #include #include +#include // utility class to redirect stderr so we can test it // inspired by https://stackoverflow.com/questions/5405016 @@ -31,14 +32,17 @@ BOOST_AUTO_TEST_SUITE(library_extract) BOOST_AUTO_TEST_CASE(test_extract_with_invalid_config) { + tbb::flow::graph g; osrm::ExtractorConfig config; config.requested_num_threads = std::thread::hardware_concurrency(); BOOST_CHECK_THROW(osrm::extract(config), std::exception); // including osrm::util::exception, osmium::io_error, etc. + g.wait_for_all(); } BOOST_AUTO_TEST_CASE(test_extract_with_valid_config) { + tbb::flow::graph g; osrm::ExtractorConfig config; config.input_path = OSRM_TEST_DATA_DIR "/monaco.osm.pbf"; config.UseDefaultOutputNames(OSRM_TEST_DATA_DIR "/monaco.osm.pbf"); @@ -46,6 +50,7 @@ BOOST_AUTO_TEST_CASE(test_extract_with_valid_config) config.small_component_size = 1000; config.requested_num_threads = std::thread::hardware_concurrency(); BOOST_CHECK_NO_THROW(osrm::extract(config)); + g.wait_for_all(); } BOOST_AUTO_TEST_CASE(test_setup_runtime_error)