summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2017-02-09 17:29:23 +0100
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2017-02-15 14:11:19 +0000
commitb5995afc790d07f15a822ae82c51ae03a19c3a8b (patch)
tree5e6ce5ef7d3b6e2710c88e5008bc08d2656abd3f
parenta0a9e8b2d7038f95cf341f34e73ddc2468cc5a07 (diff)
Fix http2 auto-test
After it started to fail (somehow it's only OpenSUSE 42.1) again and again and after a quick re-evaluation it appears the logic testing SETTINGS|ACK is incorrect. We (client side) start by sending the preface and then continue to send our request(s). The other side (server) starts from sending its SETTINGS frame. These settings must be ACKed, but apparently it can happen, that server receives a requests and sends a reply before it receives SETTINGS|ACK, resulting in replyFinished (replyFinishedWithError) signal and event loop stopping. As a result - QVERIFY(serverGotSettingsACK) fails. Task-number: QTBUG-58758 Change-Id: I8184cf459b2b88f70c646171e0115c184237fad1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
-rw-r--r--tests/auto/network/access/http2/tst_http2.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/network/access/http2/tst_http2.cpp b/tests/auto/network/access/http2/tst_http2.cpp
index 645d28ccb3..e7609b3243 100644
--- a/tests/auto/network/access/http2/tst_http2.cpp
+++ b/tests/auto/network/access/http2/tst_http2.cpp
@@ -540,6 +540,8 @@ void tst_Http2::clientPrefaceError()
void tst_Http2::serverSettingsAcked()
{
serverGotSettingsACK = true;
+ if (!nRequests)
+ stopEventLoop();
}
void tst_Http2::invalidFrame()
@@ -592,7 +594,7 @@ void tst_Http2::replyFinished()
QCOMPARE(reply->error(), QNetworkReply::NoError);
--nRequests;
- if (!nRequests)
+ if (!nRequests && serverGotSettingsACK)
stopEventLoop();
}