Skip to content

Commit c01685f

Browse files
Try to fix flaky tests
1 parent f0bb5fa commit c01685f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

unit_tests/library/extract.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <boost/algorithm/string.hpp>
88
#include <thread>
9+
#include <tbb/flow_graph.h>
910

1011
// utility class to redirect stderr so we can test it
1112
// inspired by https://stackoverflow.com/questions/5405016
@@ -31,21 +32,25 @@ BOOST_AUTO_TEST_SUITE(library_extract)
3132

3233
BOOST_AUTO_TEST_CASE(test_extract_with_invalid_config)
3334
{
35+
tbb::flow::graph g;
3436
osrm::ExtractorConfig config;
3537
config.requested_num_threads = std::thread::hardware_concurrency();
3638
BOOST_CHECK_THROW(osrm::extract(config),
3739
std::exception); // including osrm::util::exception, osmium::io_error, etc.
40+
g.wait_for_all();
3841
}
3942

4043
BOOST_AUTO_TEST_CASE(test_extract_with_valid_config)
4144
{
45+
tbb::flow::graph g;
4246
osrm::ExtractorConfig config;
4347
config.input_path = OSRM_TEST_DATA_DIR "/monaco.osm.pbf";
4448
config.UseDefaultOutputNames(OSRM_TEST_DATA_DIR "/monaco.osm.pbf");
4549
config.profile_path = OSRM_TEST_DATA_DIR "/../../profiles/car.lua";
4650
config.small_component_size = 1000;
4751
config.requested_num_threads = std::thread::hardware_concurrency();
4852
BOOST_CHECK_NO_THROW(osrm::extract(config));
53+
g.wait_for_all();
4954
}
5055

5156
BOOST_AUTO_TEST_CASE(test_setup_runtime_error)

0 commit comments

Comments
 (0)