summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2020-03-09 17:38:46 +0100
committerMårten Nordheim <marten.nordheim@qt.io>2020-03-10 09:07:16 +0100
commitad75d2712a838787488e817eec318fc27bae1786 (patch)
tree0c21ded3c4dabd059f881e82b8d44f84befcc2aa
parent5bc1a1f85fedd7d65298f0a4c8ea79fb0670c0d7 (diff)
downloadqtwebsockets-ad75d2712a838787488e817eec318fc27bae1786.tar.gz
Stabilize tst_QWebSocketServer::tst_handshakeTimeoutv5.15.0-beta2
The test was a bit flaky which seems to have been due to the short timeout. Increase the timeout a considerable amount, it doesn't matter much to the runtime anyway: the test still takes around 5 seconds to finish. Fixes: QTBUG-82559 Change-Id: Ie14ea204de1cc7ac2951144099d5be88adebef04 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r--tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp b/tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp
index a56594c..62d8d43 100644
--- a/tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp
+++ b/tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp
@@ -781,7 +781,7 @@ void tst_QWebSocketServer::tst_handshakeTimeout()
setupSecureServer(&secureServer);
if (QTest::currentTestFailed())
return;
- secureServer.setHandshakeTimeout(500);
+ secureServer.setHandshakeTimeout(2000);
QSignalSpy secureServerConnectionSpy(&secureServer, SIGNAL(newConnection()));
@@ -796,6 +796,11 @@ void tst_QWebSocketServer::tst_handshakeTimeout()
QCOMPARE(secureServerConnectionSpy.count(), 0);
QWebSocket secureSocket;
+ connect(&secureSocket, QOverload<QAbstractSocket::SocketError>::of(&QWebSocket::error),
+ [](QAbstractSocket::SocketError error) {
+ // This shouldn't print but it's useful for debugging when/if it does.
+ qDebug() << "Error occurred in the client:" << error;
+ });
QSslConfiguration config = secureSocket.sslConfiguration();
config.setPeerVerifyMode(QSslSocket::VerifyNone);
secureSocket.setSslConfiguration(config);