Skip to content

Commit

Permalink
Enable test only on Linux and disable it on Github Actions
Browse files Browse the repository at this point in the history
There seems to be a race condition that causes the test to hang when CPU
usage is high. This seems to be the issue on Github Actions, so,
we run the Gui_clean_exit_TEST only on Jenkins.

Signed-off-by: Addisu Z. Taddese <[email protected]>
  • Loading branch information
azeey committed Mar 17, 2022
1 parent 05074d7 commit 6aa3691
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/gui/Gui_clean_exit_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,18 @@ void startBoth(const std::string &_fileName)
}

/////////////////////////////////////////////////
TEST_P(GazeboDeathTest, IGN_UTILS_TEST_DISABLED_ON_MAC(CleanExit))
TEST_P(GazeboDeathTest, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(CleanExit))
{
std::string githubAction;
// This test hangs when there is high CPU usage, so we skip it on Github
// Actions.
// Note: The GITHUB_ACTIONS environment variable is automatically set when
// running on Github Actions. See https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
if (common::env("GITHUB_ACTIONS", githubAction))
{
GTEST_SKIP();
}

const auto sdfFile =
common::joinPaths(PROJECT_SOURCE_PATH, "test", "worlds", GetParam());
ASSERT_TRUE(common::exists(sdfFile))
Expand All @@ -92,6 +102,6 @@ INSTANTIATE_TEST_SUITE_P(WorldFiles, GazeboDeathTest,
int main(int _argc, char **_argv)
{
::testing::InitGoogleTest(&_argc, _argv);
::testing::FLAGS_gtest_death_test_style = "threadsafe";
::testing::FLAGS_gtest_death_test_style = "fast";
return RUN_ALL_TESTS();
}

0 comments on commit 6aa3691

Please sign in to comment.