Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1128)

Issue 2523583003: Fix some flaky tests. (Closed)

Created:
4 years, 1 month ago by Alexander Semashko
Modified:
4 years ago
Reviewers:
ncarter (slow), nasko
CC:
chromium-reviews, jam, darin-cc_chromium.org, site-isolation-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

NavigationControllerBrowserTest.RaceCrossOriginNavigationAndSamePageHistoryNavigation: Since cross_origin_commit_observer.Wait() does not really stop right after commit, nothing prevents the history nav to commit too during this wait. SitePerProcessBrowserTest.NavigateInUnloadHandler: Navigation to c.com could commit while ExecuteScript was spinning the loop, then deleted_observer binds to C's RFH and waits forever. SitePerProcessBrowserTest.RenderViewHostIsNotReusedAfterDelayedSwapOutACK: During handling of navigation commit in the browser, SwapOut message is sent to the renderer, which asks its host to shut down; commit_observer.WaitForCommit may spin the loop until this request is satisfied, and after return the test accesses dead objects. Regarding the change in DOMMessageQueue::WaitForMessage: It was possible for NavigateInUnloadHandler to fail because of this. With reordering code in the test itself, this change is not really necessary, but to me it seems right to keep it - this is not the place where the loop should be spinned always, unconditionally. BTW, I'm planning to discuss (on chromium-dev) a broader proposal to change things like this. BUG=668707 Committed: https://crrev.com/ba2d61725438457920b12f562894b7aa7eb1fea1 Cr-Commit-Position: refs/heads/master@{#434643}

Patch Set 1 #

Total comments: 10

Patch Set 2 : Use better name. #

Patch Set 3 : Fix race in SupervisedUserTestBase::StartUserCreation. #

Patch Set 4 : Undo change in DOMMessageQueue. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -9 lines) Patch
M content/browser/site_per_process_browsertest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M content/public/test/test_frame_navigation_observer.cc View 1 chunk +2 lines, -1 line 0 comments Download
M content/public/test/test_utils.h View 1 2 chunks +13 lines, -1 line 0 comments Download
M content/public/test/test_utils.cc View 1 2 chunks +10 lines, -4 lines 0 comments Download
M content/test/content_browser_test_utils_internal.cc View 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 42 (24 generated)
Alexander Semashko
4 years, 1 month ago (2016-11-22 14:56:37 UTC) #3
nasko
Thanks for this CL! Adding nick@, who I think will be interested in also looking ...
4 years ago (2016-11-23 17:48:29 UTC) #6
Alexander Semashko
https://codereview.chromium.org/2523583003/diff/1/content/browser/site_per_process_browsertest.cc File content/browser/site_per_process_browsertest.cc (right): https://codereview.chromium.org/2523583003/diff/1/content/browser/site_per_process_browsertest.cc#newcode8361 content/browser/site_per_process_browsertest.cc:8361: root->child_at(0)->child_at(0)->current_frame_host()); On 2016/11/23 17:48:29, nasko wrote: > I agree ...
4 years ago (2016-11-23 18:38:08 UTC) #7
nasko
LGTM with one comment on the quit type naming. https://codereview.chromium.org/2523583003/diff/1/content/browser/site_per_process_browsertest.cc File content/browser/site_per_process_browsertest.cc (right): https://codereview.chromium.org/2523583003/diff/1/content/browser/site_per_process_browsertest.cc#newcode8361 content/browser/site_per_process_browsertest.cc:8361: ...
4 years ago (2016-11-24 00:00:44 UTC) #8
Alexander Semashko
https://codereview.chromium.org/2523583003/diff/1/content/public/test/test_utils.h File content/public/test/test_utils.h (right): https://codereview.chromium.org/2523583003/diff/1/content/public/test/test_utils.h#newcode101 content/public/test/test_utils.h:101: MessageLoopRunner(QuitMode mode = QuitMode::LOOSE); On 2016/11/24 00:00:43, nasko wrote: ...
4 years ago (2016-11-24 10:31:43 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2523583003/20001
4 years ago (2016-11-25 08:52:53 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/322126)
4 years ago (2016-11-25 10:02:47 UTC) #14
Alexander Semashko
On 2016/11/25 10:02:47, commit-bot: I haz the power wrote: > Try jobs failed on following ...
4 years ago (2016-11-28 12:09:59 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2523583003/60001
4 years ago (2016-11-28 13:03:14 UTC) #29
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years ago (2016-11-28 13:07:22 UTC) #32
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/ba2d61725438457920b12f562894b7aa7eb1fea1 Cr-Commit-Position: refs/heads/master@{#434643}
4 years ago (2016-11-28 13:09:56 UTC) #34
Alexander Semashko
BTW... nasko, can you help me to get try job access? Looks like without it ...
4 years ago (2016-11-28 18:33:26 UTC) #35
nasko
On 2016/11/28 18:33:26, Alexander Semashko wrote: > BTW... > nasko, can you help me to ...
4 years ago (2016-11-28 22:21:42 UTC) #36
Alexander Semashko
On 2016/11/28 22:21:42, nasko wrote: > On 2016/11/28 18:33:26, Alexander Semashko wrote: > > BTW... ...
4 years ago (2016-11-29 07:41:51 UTC) #37
stgao
Would it be possible that this CL make these two tests flaky? FindRequestManagerTests/FindRequestManagerTest.AddFrame/1 FindRequestManagerTests/FindRequestManagerTest.NavigateFrame/1 https://findit-for-me.appspot.com/waterfall/check-flake?master_name=chromium.win&builder_name=Win7%20Tests%20(1)&build_number=60523&step_name=content_browsertests%20on%20Windows-7-SP1&test_name=FindRequestManagerTests/FindRequestManagerTest.AddFrame/1 ...
4 years ago (2016-12-02 01:22:54 UTC) #38
Alexander Semashko
On 2016/12/02 01:22:54, stgao (slow on Monday) wrote: > Would it be possible that this ...
4 years ago (2016-12-02 07:50:36 UTC) #39
stgao
On 2016/12/02 07:50:36, Alexander Semashko wrote: > On 2016/12/02 01:22:54, stgao (slow on Monday) wrote: ...
4 years ago (2016-12-06 05:24:06 UTC) #41
Alexander Semashko
4 years ago (2016-12-07 14:22:09 UTC) #42
Message was sent while issue was closed.
On 2016/12/06 05:24:06, stgao (slow on Monday) wrote:
> On 2016/12/02 07:50:36, Alexander Semashko wrote:
> > On 2016/12/02 01:22:54, stgao (slow on Monday) wrote:
> > > Would it be possible that this CL make these two tests flaky?
> > > 
> > > FindRequestManagerTests/FindRequestManagerTest.AddFrame/1 
> > > FindRequestManagerTests/FindRequestManagerTest.NavigateFrame/1 
> > > 
> > >
> >
>
https://findit-for-me.appspot.com/waterfall/check-flake?master_name=chromium....
> > > 
> > >
> >
>
https://findit-for-me.appspot.com/waterfall/check-flake?master_name=chromium....
> > 
> > From the first glance, no: these tests do not use neither
> > TestFrameNavigationObserver nor UrlCommitObserver, and this CL did not
change
> > anything else.
> > I'll look into it deeper today.
> 
> Thanks for confirming!

Sorry, I was not able to get back to this issues on friday. And it appears that
I was not right - missed the fact that TestFrameNavigationObserver is used in
NavigateFrameToURL from content_browser_test_utils_internal, which is used in
find request manager tests. So it is very likely that this CL made those tests
flaky.

In NavigateFrameToURL the observer waits for DidStopLoading. What this CL did
change is only that no more tasks are processed during this wait. This can be
completely patched out by calling RunAllPendingInMessageLoop after
NavigateFrameToURL, I think, though it may be undesirable.

Unless there is a bug in underlying code, like DidStopLoading firing too early,
I suppose that after the WebContents stop loading something happens that affects
find-in-page operation. It might be expected, or might be a bug, I don't know.
In the first case this should be accounted for in the tests, probably by just
running pending tasks - it is ok if there is no cross-thread or cross-process
dependencies and no delayed tasks. Though, considering that there are other
flaky FindRequestManagerTests, including those that were flaky long before this
CL landed, I guess that there is some more complex condition to wait for, or
just a plain old bug that must be fixed.

Powered by Google App Engine
This is Rietveld 408576698