From ad75d2712a838787488e817eec318fc27bae1786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Mon, 9 Mar 2020 17:38:46 +0100 Subject: Stabilize tst_QWebSocketServer::tst_handshakeTimeout 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 --- tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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::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); -- cgit v1.2.1