Skip to content

Commit

Permalink
Try to fix flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SiarheiFedartsou committed Nov 3, 2024
1 parent f0bb5fa commit c01685f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions unit_tests/library/extract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <boost/algorithm/string.hpp>
#include <thread>
#include <tbb/flow_graph.h>

// utility class to redirect stderr so we can test it
// inspired by https://stackoverflow.com/questions/5405016
Expand All @@ -31,21 +32,25 @@ 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");
config.profile_path = OSRM_TEST_DATA_DIR "/../../profiles/car.lua";
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)
Expand Down

0 comments on commit c01685f

Please sign in to comment.