Skip to content

Commit

Permalink
process qt events to allow scene to initialize
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
  • Loading branch information
scpeters committed May 7, 2021
1 parent 899b97a commit 341db2a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/integration/scene3d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ TEST(Scene3DTest, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Config))
auto engine = rendering::engine("ogre");
ASSERT_NE(nullptr, engine);

int sleep = 0;
int maxSleep = 30;
while (0 == engine->SceneCount() && sleep < maxSleep)
{
std::this_thread::sleep_for(std::chrono::milliseconds(100));
QCoreApplication::processEvents();
sleep++;
}

EXPECT_EQ(1u, engine->SceneCount());
auto scene = engine->SceneByName("banana");
ASSERT_NE(nullptr, scene);
Expand Down

0 comments on commit 341db2a

Please sign in to comment.