From 0c4b2779ff1c41bbcae33960313d764a91757596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Fri, 6 Oct 2023 13:36:00 +0200 Subject: [PATCH] tst_http2::redirect: reduce length of test By fixing how many requests we are expecting to _finish_. Since the nRequests variable is only decreased once a request is finished, we only actually expect 1. No matter how many times it gets redirected. This was the slowest test-function in the test, clocking in at 10 seconds. Now it's sub 500ms. Pick-to: 6.6 6.5 Change-Id: I544360f0928466c1bc0fbc6806952ccec588d131 Reviewed-by: Timur Pocheptsov --- tests/auto/network/access/http2/tst_http2.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/auto/network/access/http2/tst_http2.cpp b/tests/auto/network/access/http2/tst_http2.cpp index 1b0c074a6e..bcb94ac439 100644 --- a/tests/auto/network/access/http2/tst_http2.cpp +++ b/tests/auto/network/access/http2/tst_http2.cpp @@ -1244,7 +1244,7 @@ void tst_Http2::redirect() QVERIFY(serverPort != 0); - nRequests = 1 + maxRedirects; + nRequests = 1; auto originalUrl = requestUrl(defaultConnectionType()); auto url = originalUrl; @@ -1272,6 +1272,7 @@ void tst_Http2::redirect() runEventLoop(); STOP_ON_FAILURE + QCOMPARE(nRequests, 0); if (success) { QCOMPARE(reply->error(), QNetworkReply::NoError); QCOMPARE(reply->url().toString(),