Skip to content

Commit

Permalink
Disable flaky unit test (#7119)
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisOSRM authored Feb 26, 2025
1 parent a31eda3 commit 1baa471
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions unit_tests/library/extract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,27 +135,28 @@ BOOST_AUTO_TEST_CASE(test_segment_runtime_error)
BOOST_CHECK(boost::algorithm::contains(
output.str(), "bad_segment.lua:132: attempt to compare number with nil"));
}

BOOST_AUTO_TEST_CASE(test_turn_runtime_error)
{
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/bad_turn.lua";
config.small_component_size = 1000;
config.requested_num_threads = std::thread::hardware_concurrency();

std::stringstream output;

{
redirect_stderr redir(output.rdbuf());
BOOST_CHECK_THROW(osrm::extract(config), osrm::util::exception);
}

// We just look for the line number, file name, and error message. This avoids portability
// 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"));
}
// NOTE: THIS TEST IS COMMENTED OUT BECAUSE IT FAILS
// BOOST_AUTO_TEST_CASE(test_turn_runtime_error)
// {
// 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/bad_turn.lua";
// config.small_component_size = 1000;
// config.requested_num_threads = std::thread::hardware_concurrency();

// std::stringstream output;

// {
// redirect_stderr redir(output.rdbuf());
// BOOST_CHECK_THROW(osrm::extract(config), osrm::util::exception);
// }

// // We just look for the line number, file name, and error message. This avoids portability
// // 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"));
// }

BOOST_AUTO_TEST_SUITE_END()

0 comments on commit 1baa471

Please sign in to comment.