Bug 187389 - Layout Test editing/selection/navigation-clears-editor-state.html is flaky
Summary: Layout Test editing/selection/navigation-clears-editor-state.html is flaky
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-07-06 09:16 PDT by Truitt Savell
Modified: 2018-10-25 09:45 PDT (History)
9 users (show)

See Also:


Attachments
patch (1.38 KB, patch)
2018-07-06 10:02 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
Another fix attempt (1.85 KB, patch)
2018-07-11 20:34 PDT, Ryosuke Niwa
wenson_hsieh: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Truitt Savell 2018-07-06 09:16:36 PDT
The following layout test is flaky on Sierra and High Sierra WK1

editing/selection/navigation-clears-editor-state.html

Probable cause:

I do not know, though it seems to have begun around revision r233184

Flakiness Dashboard:

https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=editing%2Fselection%2Fnavigation-clears-editor-state.html

looking into issue further
Comment 1 Ryan Haddad 2018-07-06 09:27:30 PDT
Saam attempted to fix this in https://trac.webkit.org/changeset/233555, it it failing after that revision?
Comment 2 Truitt Savell 2018-07-06 09:31:40 PDT
Yes its still flakey after that revision. But it seems like his revision might have fixed the test for windows.
Comment 3 Saam Barati 2018-07-06 10:02:13 PDT
Created attachment 344423 [details]
patch
Comment 4 WebKit Commit Bot 2018-07-06 10:44:42 PDT
Comment on attachment 344423 [details]
patch

Clearing flags on attachment: 344423

Committed r233581: <https://trac.webkit.org/changeset/233581>
Comment 5 WebKit Commit Bot 2018-07-06 10:44:43 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2018-07-06 10:46:16 PDT
<rdar://problem/41898822>
Comment 7 Truitt Savell 2018-07-06 14:41:56 PDT
So it looks like after that new revision the test is constantly failing on Sierra and High Sierra Debug WK1 and WK2.

example of failure message:
https://build.webkit.org/results/Apple%20High%20Sierra%20Debug%20WK1%20(Tests)/r233581%20(4602)/editing/selection/navigation-clears-editor-state-pretty-diff.html
Comment 8 Ryan Haddad 2018-07-06 14:43:58 PDT
Reopening per Truitt's comment.
Comment 9 Ryosuke Niwa 2018-07-10 14:22:34 PDT
I think we just need to skip this test on debug bots. It's too slow there.
Comment 10 Saam Barati 2018-07-10 14:44:38 PDT
(In reply to Ryosuke Niwa from comment #9)
> I think we just need to skip this test on debug bots. It's too slow there.

Agreed. I'll do this.
Comment 11 Saam Barati 2018-07-10 14:53:23 PDT
(In reply to Saam Barati from comment #10)
> (In reply to Ryosuke Niwa from comment #9)
> > I think we just need to skip this test on debug bots. It's too slow there.
> 
> Agreed. I'll do this.

I spoke with Ryosuke offline. We're going to start by just removing the 18 second timeout.
Comment 12 Saam Barati 2018-07-10 14:53:41 PDT
(In reply to Saam Barati from comment #11)
> (In reply to Saam Barati from comment #10)
> > (In reply to Ryosuke Niwa from comment #9)
> > > I think we just need to skip this test on debug bots. It's too slow there.
> > 
> > Agreed. I'll do this.
> 
> I spoke with Ryosuke offline. We're going to start by just removing the 18
> second timeout.

We're also going to mark it slow on Debug
Comment 13 Saam Barati 2018-07-10 14:56:43 PDT
(In reply to Saam Barati from comment #12)
> (In reply to Saam Barati from comment #11)
> > (In reply to Saam Barati from comment #10)
> > > (In reply to Ryosuke Niwa from comment #9)
> > > > I think we just need to skip this test on debug bots. It's too slow there.
> > > 
> > > Agreed. I'll do this.
> > 
> > I spoke with Ryosuke offline. We're going to start by just removing the 18
> > second timeout.
> 
> We're also going to mark it slow on Debug

Actually, our new approach will be:
- lower iframe count from 200 to 100
- remove 18 second timer

We'll mark it as slow in the future if it times out.
Comment 14 Saam Barati 2018-07-10 15:01:00 PDT
(In reply to Saam Barati from comment #13)
> (In reply to Saam Barati from comment #12)
> > (In reply to Saam Barati from comment #11)
> > > (In reply to Saam Barati from comment #10)
> > > > (In reply to Ryosuke Niwa from comment #9)
> > > > > I think we just need to skip this test on debug bots. It's too slow there.
> > > > 
> > > > Agreed. I'll do this.
> > > 
> > > I spoke with Ryosuke offline. We're going to start by just removing the 18
> > > second timeout.
> > 
> > We're also going to mark it slow on Debug
> 
> Actually, our new approach will be:
> - lower iframe count from 200 to 100
> - remove 18 second timer
> 
> We'll mark it as slow in the future if it times out.

Landed in:
https://trac.webkit.org/changeset/233701/webkit
Comment 15 Truitt Savell 2018-07-11 10:45:24 PDT
After r233701 <https://trac.webkit.org/changeset/233701/webkit>

Failure is back to being Flaky on WK1 Release Platforms. It has stopped failing on Debug.

Example of test output on failure:

--- /Volumes/Data/slave/highsierra-release-tests-wk1/build/layout-test-results/editing/selection/navigation-clears-editor-state-expected.txt
+++ /Volumes/Data/slave/highsierra-release-tests-wk1/build/layout-test-results/editing/selection/navigation-clears-editor-state-actual.txt
@@ -3,7 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS freed more than 15% of documents
+FAIL freed less than 15% of documents
 PASS successfullyParsed is true
 
 TEST COMPLETE

Test History: 
https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=editing%2Fselection%2Fnavigation-clears-editor-state.html
Comment 16 Mark Lam 2018-07-11 10:51:08 PDT
(In reply to Truitt Savell from comment #15)
> After r233701 <https://trac.webkit.org/changeset/233701/webkit>
> 
> Failure is back to being Flaky on WK1 Release Platforms. It has stopped
> failing on Debug.
> 
> Example of test output on failure:
> 
> ---
> /Volumes/Data/slave/highsierra-release-tests-wk1/build/layout-test-results/
> editing/selection/navigation-clears-editor-state-expected.txt
> +++
> /Volumes/Data/slave/highsierra-release-tests-wk1/build/layout-test-results/
> editing/selection/navigation-clears-editor-state-actual.txt
> @@ -3,7 +3,7 @@
>  On success, you will see a series of "PASS" messages, followed by "TEST
> COMPLETE".
>  
>  
> -PASS freed more than 15% of documents
> +FAIL freed less than 15% of documents
>  PASS successfullyParsed is true
>  
>  TEST COMPLETE
> 
> Test History: 
> https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.
> html#showAllRuns=true&tests=editing%2Fselection%2Fnavigation-clears-editor-
> state.html

How about adding <!-- webkit-test-runner [ jscOptions=--useConcurrentGC=false ] --> to the top of the test?  That should make the GCing more consistent.
Comment 17 Saam Barati 2018-07-11 13:18:58 PDT
Ugh, we are putting more attention than needed into this test IMO. I say we just mark it as flaky and move on.
Comment 18 Saam Barati 2018-07-11 13:19:25 PDT
(In reply to Mark Lam from comment #16)
> (In reply to Truitt Savell from comment #15)
> > After r233701 <https://trac.webkit.org/changeset/233701/webkit>
> > 
> > Failure is back to being Flaky on WK1 Release Platforms. It has stopped
> > failing on Debug.
> > 
> > Example of test output on failure:
> > 
> > ---
> > /Volumes/Data/slave/highsierra-release-tests-wk1/build/layout-test-results/
> > editing/selection/navigation-clears-editor-state-expected.txt
> > +++
> > /Volumes/Data/slave/highsierra-release-tests-wk1/build/layout-test-results/
> > editing/selection/navigation-clears-editor-state-actual.txt
> > @@ -3,7 +3,7 @@
> >  On success, you will see a series of "PASS" messages, followed by "TEST
> > COMPLETE".
> >  
> >  
> > -PASS freed more than 15% of documents
> > +FAIL freed less than 15% of documents
> >  PASS successfullyParsed is true
> >  
> >  TEST COMPLETE
> > 
> > Test History: 
> > https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.
> > html#showAllRuns=true&tests=editing%2Fselection%2Fnavigation-clears-editor-
> > state.html
> 
> How about adding <!-- webkit-test-runner [
> jscOptions=--useConcurrentGC=false ] --> to the top of the test?  That
> should make the GCing more consistent.

I believe the test is calling sync GCs manually. So I don't see how this will help
Comment 19 Saam Barati 2018-07-11 13:20:01 PDT
We could also just bump up the iteration count a bit again
Comment 20 Mark Lam 2018-07-11 13:29:08 PDT
(In reply to Saam Barati from comment #18)
> (In reply to Mark Lam from comment #16)
> > How about adding <!-- webkit-test-runner [
> > jscOptions=--useConcurrentGC=false ] --> to the top of the test?  That
> > should make the GCing more consistent.
> 
> I believe the test is calling sync GCs manually. So I don't see how this
> will help

You're right: GCController.collect() ultimately ends up in GCController::garbageCollectNow() in the web process.  So, this wouldn't help.
Comment 21 Ryosuke Niwa 2018-07-11 20:31:29 PDT
I think this test is just slow. I think 200 was working fine. So let's go back there and just mark this test as SLOW.
Comment 22 Ryosuke Niwa 2018-07-11 20:34:40 PDT
Created attachment 344816 [details]
Another fix attempt
Comment 23 Ryosuke Niwa 2018-07-11 20:36:20 PDT
Committed r233754: <https://trac.webkit.org/changeset/233754>
Comment 24 Ryosuke Niwa 2018-07-13 21:21:02 PDT
Looks like this latest change finally made it stable!
Comment 25 Saam Barati 2018-07-14 11:01:33 PDT
(In reply to Ryosuke Niwa from comment #24)
> Looks like this latest change finally made it stable!

Great! Thanks Ryosuke