summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2022-06-01 17:19:19 +0200
committerMichal Klocek <michal.klocek@qt.io>2022-06-04 15:41:15 +0200
commit53f3775a532c8a926f3c7ba7d1daf8ada72be306 (patch)
treec4973876f4aefbfeb804a567f0d3d7c7110034ff
parentaf8d1bc0743a55dfafb7f45e132ac011fed1c9a2 (diff)
Fix flakiness of jsServiceWorker test
This is an interesting issue as in the test sometimes first party url of intercepted request has "sw.js" instead of "sw.html". After deep debug of the issue the reason behind is that a service worker registration job checks the registration for given scope and the key, this in the turn will check storage in ServiceWorkerStorage::FindRegistrationForScope. Now if registration is found this will trigger service worker update checker, which fires the request check for newer version for sw.js and makes an intercepted request with sw.js as first party url. This of course brakes the test. Do not use the storage in that test, and let the service worker registration job do full "install" & "register" cycle instead of running "update" phase. As a side note , using off the record profile makes test run faster as opening the storage and closing it is costly. Pick-to: 6.3 6.2 Change-Id: If13a4fcf0014cc5c76cb8ed14e60f2e5e29c67ef Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
index 0723be0f3..a3f3cc3e3 100644
--- a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
@@ -727,7 +727,7 @@ void tst_QWebEngineUrlRequestInterceptor::jsServiceWorker()
server.setResourceDirs({ QDir(QT_TESTCASE_SOURCEDIR).canonicalPath() + "/resources" });
QVERIFY(server.start());
- QWebEngineProfile profile(QStringLiteral("Test"));
+ QWebEngineProfile profile;
std::unique_ptr<ConsolePage> page;
page.reset(new ConsolePage(&profile));
TestRequestInterceptor interceptor(/* intercept */ false);