Skip to content

Commit 6aa3691

Browse files
committed
Enable test only on Linux and disable it on Github Actions
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]>
1 parent 05074d7 commit 6aa3691

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/gui/Gui_clean_exit_TEST.cc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,18 @@ void startBoth(const std::string &_fileName)
7373
}
7474

7575
/////////////////////////////////////////////////
76-
TEST_P(GazeboDeathTest, IGN_UTILS_TEST_DISABLED_ON_MAC(CleanExit))
76+
TEST_P(GazeboDeathTest, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(CleanExit))
7777
{
78+
std::string githubAction;
79+
// This test hangs when there is high CPU usage, so we skip it on Github
80+
// Actions.
81+
// Note: The GITHUB_ACTIONS environment variable is automatically set when
82+
// running on Github Actions. See https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
83+
if (common::env("GITHUB_ACTIONS", githubAction))
84+
{
85+
GTEST_SKIP();
86+
}
87+
7888
const auto sdfFile =
7989
common::joinPaths(PROJECT_SOURCE_PATH, "test", "worlds", GetParam());
8090
ASSERT_TRUE(common::exists(sdfFile))
@@ -92,6 +102,6 @@ INSTANTIATE_TEST_SUITE_P(WorldFiles, GazeboDeathTest,
92102
int main(int _argc, char **_argv)
93103
{
94104
::testing::InitGoogleTest(&_argc, _argv);
95-
::testing::FLAGS_gtest_death_test_style = "threadsafe";
105+
::testing::FLAGS_gtest_death_test_style = "fast";
96106
return RUN_ALL_TESTS();
97107
}

0 commit comments

Comments
 (0)