Page MenuHomePhabricator

[RevisionSlider] QUnit test ext.RevisionSlider.DiffPage "Push state" fails due to Chrome rate limiting history.pushState
Closed, ResolvedPublic5 Estimated Story Points

Description

Summary: Chromium v61 throttles history.pushState (commit). v67 lets one disable it via --disable-pushstate-throttle (commit ).

ext.RevisionSlider.DiffPage
 ✔ Initialize DiffPage
  ✖ Push state


FAILED TESTS:
  ext.RevisionSlider.DiffPage
    ✖ Push state
      HeadlessChrome 0.0.0 (Linux 0.0.0)
    Expected: 2
    Actual: 1
        at Object.<anonymous> (http://localhost:9876/load.php?debug=false&lang=en&modules=color-picker%2CdiffMatchPatch%2Cdompurify%7Cext.RevisionSlider.DiffPage%2CHelpDialog%2CPointer%2CPointerLine%2CPointerView%2CRevision%2CRevisionList%2CRevisionListView%2CSlider%2CSliderView%2CdialogImages%2Ctests%2Cutil%7Cext.centralauth.ForeignApi%7Cext.centralauth.ForeignApi.test%7Cext.cite.style%2Cstyles%2CvisualEditor%7Cext.cite.visualEditor.core%2Cdata%2Cicons%2Ctest%7Cext.echo.api%2Cdm%7Cext.echo.dm.tests%7Cext.eventLogging%7Cext.eventLogging.subscriber%2Ctests%7Cext.visualEditor.articleTarget%2Cbase%2CcommentAnnotation%2Ccore%2Cdata%2CdesktopArticleTarget%2CdesktopTarget%2Cdiffing%2Cexperimental%2Cicons%2Clanguage%2Cmediawiki%2CmoduleIcons%2Cmwalienextension%2Cmwcore%2Cmwextensionmessages%2Cmwextensions%2Cmwformatting%2Cmwgallery%2Cmwimage%2Cmwlanguage%2Cmwlink%2Cmwmeta%2Cmwsave%2Cmwtransclusion%2Crebase%2Csanitize%2CsupportCheck%2Cswitching%2CtargetLoader%2CtempWikitextEditorWidget%2Ctest%2Ctrack%2Cve%2Cwelcome%7Cext.visualEditor.core.desktop%7Cext.visualEditor.desktopArticleTarget.init%7Cext.visualEditor.mwextensions.desktop%7Cext.visualEditor.mwimage.core%7Cext.wikiEditor.toolbar.test%7Cjquery.accessKeyLabel%2Casync%2CcheckboxShiftClick%2Cclient%2Ccolor%2CcolorUtil%2Ccookie%2CgetAttrs%2Chidpi%2ChighlightText%2ClengthLimit%2Clocalize%2CmakeCollapsible%2Csuggestions%2CtabIndex%2Ctablesorter%2CtextSelection%2Cthrottle-debounce%7Cjquery.makeCollapsible.styles%7Cjquery.uls.data%7Cmediawiki.ForeignApi%2CForeignStructuredUpload%2CForeignUpload%2CRegExp%2CString%2CTitle%2CUpload%2CUri%2Capi%2Ccldr%2CconfirmCloseWindow%2Ccookie%2Cexperiments%2Cinspect%2CjqueryMsg%2Clanguage%2CmessagePoster%2Cnotification%7Cmediawiki.ForeignApi.core%7Cmediawiki.ForeignStructuredUpload.BookletLayout%2Cconfig%7Cmediawiki.Upload.BookletLayout%2CDialog%7Cmediawiki.action.view.redirectPage%7Cmediawiki.diff.styles%7Cmediawiki.editfont.styles%7Cmediawiki.language.data%2Cinit%2Cmonths%2Cnames%2CspecialCharacters%7Cmediawiki.libs.jpegmeta%2Cpluralruleparser&skin=vector&version=19bq1ik:141:439)
        at runTest (node_modules/qunit/qunit/qunit.js:1530:30)
        at Test.run (node_modules/qunit/qunit/qunit.js:1516:6)
        at node_modules/qunit/qunit/qunit.js:1728:12
        at advanceTaskQueue (node_modules/qunit/qunit/qunit.js:1129:6)
        at advance (node_modules/qunit/qunit/qunit.js:1110:4)

Spotted via the experimental Quibble job by commenting check experimental on a dummy change: https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/RevisionSlider/+/363822/

The job runs in a Docker container that has Chrome v66.

Locally, the test passes with Firefox 52 and fail with Chrome 66.0.3359:

RevisionSlider_Qunit_failure.png (453×528 px, 32 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Lea_WMDE set the point value for this task to 5.Jun 26 2018, 12:55 PM
Vvjjkkii renamed this task from [RevisionSlider] QUnit test ext.RevisionSlider.DiffPage "Push state" fails to kaaaaaaaaa.Jul 1 2018, 1:01 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed the point value for this task.
Vvjjkkii removed a subscriber: Aklapper.
JJMC89 renamed this task from kaaaaaaaaa to [RevisionSlider] QUnit test ext.RevisionSlider.DiffPage "Push state" fails.Jul 1 2018, 3:03 AM
JJMC89 raised the priority of this task from High to Needs Triage.
JJMC89 updated the task description. (Show Details)
JJMC89 set the point value for this task to 5.
JJMC89 added a subscriber: Aklapper.

The test fails in Chrome 67 as well. The code is:

tests/qunit/RevisionSlider.DiffPage.test.js
histLength = history.length;

diffPage.pushState( 3, 37, sliderView );

assert.equal( history.length, histLength + 1 );
assert.propEqual(
    history.state,
    {
        diff: 3, 
        oldid: 37,
        pointerOlderPos: 1,
        pointerNewerPos: 3,
        sliderPos: NaN
    }
);

I noticed the Chrome console outputting:

VM439:609 Throttling history state changes to prevent the browser from hanging.

And sometime history.state is null ....

Using Special:JavaScriptTest, if I rerun the test it always pass.

Some upstream issue: https://bugs.chromium.org/p/chromium/issues/detail?id=769592

hashar renamed this task from [RevisionSlider] QUnit test ext.RevisionSlider.DiffPage "Push state" fails to [RevisionSlider] QUnit test ext.RevisionSlider.DiffPage "Push state" fails due to Chrome rate limiting history.pushState.Jul 10 2018, 12:47 PM
hashar added a project: Quibble.

Change 444871 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/quibble@master] Chrome: do not rate limit history.pushState()

https://gerrit.wikimedia.org/r/444871

Change 444871 merged by jenkins-bot:
[integration/quibble@master] Chrome: do not rate limit history.pushState()

https://gerrit.wikimedia.org/r/444871

Change 444876 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] docker: quibble 0.0.20

https://gerrit.wikimedia.org/r/444876

Change 444877 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] Bump Quibble jobs based on Stretch to 0.0.20

https://gerrit.wikimedia.org/r/444877

Change 444876 merged by jenkins-bot:
[integration/config@master] docker: quibble 0.0.20

https://gerrit.wikimedia.org/r/444876

Change 444877 merged by jenkins-bot:
[integration/config@master] Bump Quibble jobs based on Stretch to 0.0.20

https://gerrit.wikimedia.org/r/444877

Change 444884 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] Migrate RevisionSlider to Quibble

https://gerrit.wikimedia.org/r/444884

hashar claimed this task.

Change 444884 merged by jenkins-bot:
[integration/config@master] Migrate RevisionSlider to Quibble

https://gerrit.wikimedia.org/r/444884