Fix remote proxy test timing
This commit is contained in:
parent
56948912dd
commit
434ed30f5e
@ -508,26 +508,26 @@ void RemoteProxyTestsProxy::authenticate_data()
|
|||||||
QTest::addColumn<Authenticator::AuthenticationError>("expectedError");
|
QTest::addColumn<Authenticator::AuthenticationError>("expectedError");
|
||||||
|
|
||||||
QTest::newRow("success") << QUuid::createUuid().toString() << "Testclient, hello form the test!" << m_testToken << ""
|
QTest::newRow("success") << QUuid::createUuid().toString() << "Testclient, hello form the test!" << m_testToken << ""
|
||||||
<< 100 << Authenticator::AuthenticationErrorNoError;
|
<< 500 << Authenticator::AuthenticationErrorNoError;
|
||||||
|
|
||||||
QTest::newRow("success") << QUuid::createUuid().toString() << "Testclient, hello form the test!" << m_testToken << "nonce"
|
QTest::newRow("success") << QUuid::createUuid().toString() << "Testclient, hello form the test!" << m_testToken << "nonce"
|
||||||
<< 100 << Authenticator::AuthenticationErrorNoError;
|
<< 500 << Authenticator::AuthenticationErrorNoError;
|
||||||
|
|
||||||
QTest::newRow("success") << QUuid::createUuid().toString() << "Testclient, hello form the test!" << m_testToken << "nonce"
|
QTest::newRow("success") << QUuid::createUuid().toString() << "Testclient, hello form the test!" << m_testToken << "nonce"
|
||||||
<< 100 << Authenticator::AuthenticationErrorAuthenticationFailed;
|
<< 300 << Authenticator::AuthenticationErrorAuthenticationFailed;
|
||||||
|
|
||||||
|
|
||||||
QTest::newRow("failed") << QUuid::createUuid().toString() << "Testclient, hello form the test!" << m_testToken << ""
|
QTest::newRow("failed") << QUuid::createUuid().toString() << "Testclient, hello form the test!" << m_testToken << ""
|
||||||
<< 100 << Authenticator::AuthenticationErrorAuthenticationFailed;
|
<< 300 << Authenticator::AuthenticationErrorAuthenticationFailed;
|
||||||
|
|
||||||
QTest::newRow("not responding") << QUuid::createUuid().toString() << "Testclient, hello form the test!" << m_testToken << ""
|
QTest::newRow("not responding") << QUuid::createUuid().toString() << "Testclient, hello form the test!" << m_testToken << ""
|
||||||
<< 200 << Authenticator::AuthenticationErrorProxyError;
|
<< 500 << Authenticator::AuthenticationErrorProxyError;
|
||||||
|
|
||||||
QTest::newRow("aborted") << QUuid::createUuid().toString() << "Testclient, hello form the test!" << m_testToken << ""
|
QTest::newRow("aborted") << QUuid::createUuid().toString() << "Testclient, hello form the test!" << m_testToken << ""
|
||||||
<< 100 << Authenticator::AuthenticationErrorAborted;
|
<< 300 << Authenticator::AuthenticationErrorAborted;
|
||||||
|
|
||||||
QTest::newRow("unknown") << QUuid::createUuid().toString() << "Testclient, hello form the test!" << m_testToken << ""
|
QTest::newRow("unknown") << QUuid::createUuid().toString() << "Testclient, hello form the test!" << m_testToken << ""
|
||||||
<< 100 << Authenticator::AuthenticationErrorUnknown;
|
<< 300 << Authenticator::AuthenticationErrorUnknown;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -543,6 +543,10 @@ void RemoteProxyTestsProxy::authenticate()
|
|||||||
// Start the server
|
// Start the server
|
||||||
startServer();
|
startServer();
|
||||||
|
|
||||||
|
m_configuration->setAuthenticationTimeout(8000);
|
||||||
|
m_configuration->setJsonRpcTimeout(10000);
|
||||||
|
m_configuration->setInactiveTimeout(10000);
|
||||||
|
|
||||||
// Configure result
|
// Configure result
|
||||||
m_mockAuthenticator->setExpectedAuthenticationError(expectedError);
|
m_mockAuthenticator->setExpectedAuthenticationError(expectedError);
|
||||||
m_mockAuthenticator->setTimeoutDuration(timeout);
|
m_mockAuthenticator->setTimeoutDuration(timeout);
|
||||||
|
|||||||
@ -266,8 +266,7 @@ QVariant BaseTest::invokeTcpSocketProxyApiCall(const QString &method, const QVar
|
|||||||
|
|
||||||
QSignalSpy dataSpy(socket, &QSslSocket::readyRead);
|
QSignalSpy dataSpy(socket, &QSslSocket::readyRead);
|
||||||
socket->write(jsonDoc.toJson(QJsonDocument::Compact) + '\n');
|
socket->write(jsonDoc.toJson(QJsonDocument::Compact) + '\n');
|
||||||
// FIXME: check why it waits the full time here
|
dataSpy.wait();
|
||||||
dataSpy.wait(500);
|
|
||||||
if (dataSpy.count() != 1) {
|
if (dataSpy.count() != 1) {
|
||||||
qWarning() << "No data received";
|
qWarning() << "No data received";
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|||||||
Reference in New Issue
Block a user