Skip to content

Commit

Permalink
Tests: Wait longer for server to start
Browse files Browse the repository at this point in the history
  • Loading branch information
hluk committed Jul 21, 2018
1 parent 4064095 commit 0cf61b5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/tests/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class TestInterfaceImpl : public TestInterface {

RETURN_ON_ERROR( readServerErrors(), "Failed to read server errors" );

return QByteArray();
return waitForServerToStart();
}

QByteArray stopServer() override
Expand Down Expand Up @@ -539,6 +539,17 @@ class TestInterfaceImpl : public TestInterface {
return "";
}

QByteArray waitForServerToStart()
{
SleepTimer t(15000);
do {
if ( run(Args() << "") == 0 )
return QByteArray();
} while ( t.sleep() );

return "Unable to start server!" + readServerErrors(ReadAllStderr);
}

std::unique_ptr<QProcess> m_server;
QByteArray m_serverErrorOutput;
QProcessEnvironment m_env;
Expand Down

0 comments on commit 0cf61b5

Please sign in to comment.