Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👩‍🌾 Make GitHub actions tests that are flaky due to display more verbose #255

Merged
merged 2 commits into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ci/after_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -x

make install

Xvfb :1 -screen 0 1280x1024x24 &
Xvfb :1 -ac -noreset -core -screen 0 1280x1024x24 &
export DISPLAY=:1.0
export RENDER_ENGINE_VALUES=ogre2
export MESA_GL_VERSION_OVERRIDE=3.3
15 changes: 11 additions & 4 deletions ogre2/src/Ogre2RenderEngine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,12 @@ void Ogre2RenderEngine::CreateResources()
void Ogre2RenderEngine::CreateRenderWindow()
{
// create dummy window
this->CreateRenderWindow(std::to_string(this->dummyWindowId), 1, 1, 1, 0);
auto res = this->CreateRenderWindow(std::to_string(this->dummyWindowId),
1, 1, 1, 0);
if (res.empty())
{
ignerr << "Failed to create dummy render window." << std::endl;
}
}

//////////////////////////////////////////////////
Expand Down Expand Up @@ -730,16 +735,18 @@ std::string Ogre2RenderEngine::CreateRenderWindow(const std::string &_handle,
window = this->ogreRoot->createRenderWindow(
stream.str(), _width, _height, false, &params);
}
catch(...)
catch(const std::exception &_e)
{
ignerr << " Unable to create the rendering window\n";
ignerr << " Unable to create the rendering window: " << _e.what()
<< std::endl;
window = nullptr;
}
}

if (attempts >= 10)
{
ignerr << "Unable to create the rendering window\n" << std::endl;
ignerr << "Unable to create the rendering window after [" << attempts
<< "] attempts." << std::endl;
return std::string();
}

Expand Down
10 changes: 6 additions & 4 deletions test/integration/camera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -242,25 +242,27 @@ void CameraTest::VisualAt(const std::string &_renderEngine)

if (x <= 100)
{
EXPECT_EQ(nullptr, vis);
EXPECT_EQ(nullptr, vis)
<< "Found [" << vis->Name() << "] at X [" << x << "]";
}
else if (x > 100 && x <= 300)
{
// Don't end test here on failure, this condition is flaky
EXPECT_NE(nullptr, vis) << x;
EXPECT_NE(nullptr, vis) << "X: " << x;
if (vis)
{
EXPECT_EQ("sphere", vis->Name());
}
}
else if (x > 300 && x <= 400)
{
EXPECT_EQ(nullptr, vis);
EXPECT_EQ(nullptr, vis)
<< "Found [" << vis->Name() << "] at X [" << x << "]";
}
else if (x > 400 && x <= 700)
{
// Don't end test here on failure, this condition is flaky
EXPECT_NE(nullptr, vis) << x;
EXPECT_NE(nullptr, vis) << "X: " << x;
if (vis)
{
EXPECT_EQ("box", vis->Name());
Expand Down