Bug 120775 - [Qt][WK2] Cached credentials not cleared between tests
Summary: [Qt][WK2] Cached credentials not cleared between tests
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Allan Sandfeld Jensen
URL:
Keywords:
Depends on:
Blocks: 118232
  Show dependency treegraph
 
Reported: 2013-09-05 08:31 PDT by Allan Sandfeld Jensen
Modified: 2013-09-06 03:10 PDT (History)
6 users (show)

See Also:


Attachments
Patch (3.78 KB, patch)
2013-09-05 08:32 PDT, Allan Sandfeld Jensen
no flags Details | Formatted Diff | Diff
Patch (1.81 KB, patch)
2013-09-05 09:06 PDT, Allan Sandfeld Jensen
jturcotte: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Allan Sandfeld Jensen 2013-09-05 08:31:24 PDT
Some xmlhttprequests tests are flaky because they end up reusing credentials from earlier tests. The underlying problem is that QNetworkAccessManager has an internal cache of credentials that is never cleared between tests.
Comment 1 Allan Sandfeld Jensen 2013-09-05 08:32:38 PDT
Created attachment 210618 [details]
Patch

Patch moved from bug 118232
Comment 2 Allan Sandfeld Jensen 2013-09-05 08:42:13 PDT
Comment on attachment 210618 [details]
Patch

Unsetting review. Based on the output from http://build.webkit.sed.hu/builders/x86-64%20Linux%20Qt%20Release%20-%20Qt5.1%20-%20WebKit2/builds/1286

this patch appears to cause 200-300ms slower tests on all tests outside the fast directory.
Comment 3 Allan Sandfeld Jensen 2013-09-05 09:06:10 PDT
Created attachment 210624 [details]
Patch
Comment 4 Jocelyn Turcotte 2013-09-06 02:42:03 PDT
Comment on attachment 210624 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=210624&action=review

r=me
I don't like starting to pollute this file with platform code, but I can't think of a better place to do this.

> Source/WebCore/testing/Internals.cpp:282
> +        QNetworkAccessManager* qnam = context->networkAccessManager();
> +        if (qnam)
> +            qnam->clearAccessCache();

Nit: Could be shrunk to "if (QNetworkAccessManager* qnam = context->networkAccessManager())".
Comment 5 Allan Sandfeld Jensen 2013-09-06 03:10:34 PDT
Committed r155183: <http://trac.webkit.org/changeset/155183>