diff options
author | Øystein Heskestad <[email protected]> | 2025-06-05 15:58:50 +0200 |
---|---|---|
committer | Øystein Heskestad <[email protected]> | 2025-06-10 13:36:50 +0200 |
commit | 355622a84954767d2cd1dd2b57488a83afcaef1c (patch) | |
tree | 63e7437a2e2ad1b30d61e811070ae3fc728a1cc0 /tests | |
parent | 33ed6d70c87f2eb4fa9b795ab203317299cc05e7 (diff) |
To prevent test from affecting subsequent tests set keep-alive timeout
back to default settings after performing test.
Task-number: QTBUG-75087
Change-Id: I0f1d5cb1cb6fca727571d7781bb85fa0612dfd06
Reviewed-by: Matthias Rauter <[email protected]>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qhttpserver/tst_qhttpserver.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/qhttpserver/tst_qhttpserver.cpp b/tests/auto/qhttpserver/tst_qhttpserver.cpp index 1be3237..004caa7 100644 --- a/tests/auto/qhttpserver/tst_qhttpserver.cpp +++ b/tests/auto/qhttpserver/tst_qhttpserver.cpp @@ -1587,6 +1587,11 @@ void tst_QHttpServer::keepAliveTimeout() config.setKeepAliveTimeout(1s); httpserver.setConfiguration(config); + auto cleanup = qScopeGuard([this] { + QHttpServerConfiguration config; + httpserver.setConfiguration(config); + }); + const auto slowWaitTime = QString::number(6000); QNetworkRequest reqSlow(QUrl(urlBase.arg(u"/wait/"_s + slowWaitTime))); reqSlow.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true); |