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 832b576 commit 74aab7b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion unit_tests/library/extract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ BOOST_AUTO_TEST_CASE(test_extract_with_valid_config)

BOOST_AUTO_TEST_CASE(test_setup_runtime_error)
{

oneapi::tbb::task_scheduler_handle handle{tbb::attach{}};
osrm::ExtractorConfig config;
config.input_path = OSRM_TEST_DATA_DIR "/monaco.osm.pbf";
config.UseDefaultOutputNames(OSRM_TEST_DATA_DIR "/monaco.osm.pbf");
Expand All @@ -76,10 +76,12 @@ BOOST_AUTO_TEST_CASE(test_setup_runtime_error)
// issues since the output contains the full path to the file, which may change between systems
BOOST_CHECK(boost::algorithm::contains(output.str(),
"bad_setup.lua:6: attempt to compare number with nil"));
oneapi::tbb::finalize(handle);
}

BOOST_AUTO_TEST_CASE(test_way_runtime_error)
{
oneapi::tbb::task_scheduler_handle handle{tbb::attach{}};
osrm::ExtractorConfig config;
config.input_path = OSRM_TEST_DATA_DIR "/monaco.osm.pbf";
config.UseDefaultOutputNames(OSRM_TEST_DATA_DIR "/monaco.osm.pbf");
Expand All @@ -98,10 +100,12 @@ BOOST_AUTO_TEST_CASE(test_way_runtime_error)
// issues since the output contains the full path to the file, which may change between systems
BOOST_CHECK(boost::algorithm::contains(output.str(),
"bad_way.lua:41: attempt to compare number with nil"));
oneapi::tbb::finalize(handle);
}

BOOST_AUTO_TEST_CASE(test_node_runtime_error)
{
oneapi::tbb::task_scheduler_handle handle{tbb::attach{}};
osrm::ExtractorConfig config;
config.input_path = OSRM_TEST_DATA_DIR "/monaco.osm.pbf";
config.UseDefaultOutputNames(OSRM_TEST_DATA_DIR "/monaco.osm.pbf");
Expand All @@ -120,10 +124,12 @@ BOOST_AUTO_TEST_CASE(test_node_runtime_error)
// issues since the output contains the full path to the file, which may change between systems
BOOST_CHECK(boost::algorithm::contains(output.str(),
"bad_node.lua:36: attempt to compare number with nil"));
oneapi::tbb::finalize(handle);
}

BOOST_AUTO_TEST_CASE(test_segment_runtime_error)
{
oneapi::tbb::task_scheduler_handle handle{tbb::attach{}};
osrm::ExtractorConfig config;
config.input_path = OSRM_TEST_DATA_DIR "/monaco.osm.pbf";
config.UseDefaultOutputNames(OSRM_TEST_DATA_DIR "/monaco.osm.pbf");
Expand All @@ -142,10 +148,12 @@ BOOST_AUTO_TEST_CASE(test_segment_runtime_error)
// issues since the output contains the full path to the file, which may change between systems
BOOST_CHECK(boost::algorithm::contains(
output.str(), "bad_segment.lua:132: attempt to compare number with nil"));
oneapi::tbb::finalize(handle);
}

BOOST_AUTO_TEST_CASE(test_turn_runtime_error)
{
oneapi::tbb::task_scheduler_handle handle{tbb::attach{}};
osrm::ExtractorConfig config;
config.input_path = OSRM_TEST_DATA_DIR "/monaco.osm.pbf";
config.UseDefaultOutputNames(OSRM_TEST_DATA_DIR "/monaco.osm.pbf");
Expand All @@ -164,6 +172,7 @@ BOOST_AUTO_TEST_CASE(test_turn_runtime_error)
// issues since the output contains the full path to the file, which may change between systems
BOOST_CHECK(boost::algorithm::contains(output.str(),
"bad_turn.lua:122: attempt to compare number with nil"));
oneapi::tbb::finalize(handle);
}

BOOST_AUTO_TEST_SUITE_END()

0 comments on commit 74aab7b

Please sign in to comment.