Skip to content

Commit

Permalink
👩‍🌾 Make GitHub actions tests that are flaky due to display more verb…
Browse files Browse the repository at this point in the history
…ose information (#255)

Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina authored Feb 24, 2021
1 parent 64016f6 commit fd17602
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
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

0 comments on commit fd17602

Please sign in to comment.