TestController may reuse Page for which previous test changed Page::openedByDOMWithOpener to true. This may disable PSON for cross-process navigation in subsequent tests and cause flakiness. See https://webkit.org/b/203965#c3 for one example how http/tests/dom/new-window-can-target-opener.html inadvertently disabled PSON for http/tests/inspector/target/target-events-for-provisional-page.html and made it fail.
trying to find this logic in TestController..
I think it is more likely we don't swap because: navigation.hasOpenedFrames(). Meaning that the previous test opened another window via window.open().
Created attachment 383086 [details] WIP Patch
Created attachment 383087 [details] Patch
(In reply to Chris Dumez from comment #2) > I think it is more likely we don't swap because: > navigation.hasOpenedFrames(). Meaning that the previous test opened another > window via window.open(). FWIW, while debugging the failure I saw '"Browsing context been opened by DOM without 'noopener'" coming from https://trac.webkit.org/browser/webkit/trunk/Source/WebKit/UIProcess/WebProcessPool.cpp?rev=252014#L2139 Should be easy to reproduce by running: Tools/Scripts/run-webkit-tests --no-show-results --no-retry-failures --child-processes=1 http/tests/dom/new-window-can-target-opener.html http/tests/inspector/target/target-events-for-provisional-page.html
(In reply to Yury Semikhatsky from comment #5) > (In reply to Chris Dumez from comment #2) > > I think it is more likely we don't swap because: > > navigation.hasOpenedFrames(). Meaning that the previous test opened another > > window via window.open(). > > FWIW, while debugging the failure I saw > > '"Browsing context been opened by DOM without 'noopener'" > > coming from > https://trac.webkit.org/browser/webkit/trunk/Source/WebKit/UIProcess/ > WebProcessPool.cpp?rev=252014#L2139 > > > Should be easy to reproduce by running: > > Tools/Scripts/run-webkit-tests --no-show-results --no-retry-failures > --child-processes=1 http/tests/dom/new-window-can-target-opener.html > http/tests/inspector/target/target-events-for-provisional-page.html Yes, I have already confirmed that my fix addresses the flakiness with the command you provided.
(In reply to Chris Dumez from comment #6) > (In reply to Yury Semikhatsky from comment #5) > > (In reply to Chris Dumez from comment #2) > Yes, I have already confirmed that my fix addresses the flakiness with the > command you provided. Your change will certainly fix the test failure I was more concerned about the Process/Page being reused in prod. Since you mentioned hasOpenedFrames I wanted to double check if that's actually root cause because it didn't match what I saw in the output. In any case thanks for the quick fix!
Comment on attachment 383087 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=383087&action=review lgtm > Tools/WebKitTestRunner/TestController.cpp:774 > + if (!m_createdOtherPage && m_mainWebView->viewSupportsOptions(options)) Neat!
Created attachment 383091 [details] Patch
Committed r252228: <https://trac.webkit.org/changeset/252228>
<rdar://problem/57008023>