Page MenuHomePhabricator

"User should be able to change preferences" Selenium test fails when targeting mediawiki-vagrant
Closed, ResolvedPublic

Description

Similar to T180035: MediaWiki core Selenium tests fail when targeting Vagrant.

Video:

Steps to reproduce (manually):

  • change real name
  • save
  • page refreshes
  • instead of displaying new real name, old real name is displayed
  • new real name is displayed after refreshing the page

Steps to reproduce (Selenium):

  • Start mediawiki-vagrant.
  • In one one terminal tab/window:
chromedriver --url-base=/wd/hub --port=4444
  • In another terminal tab/window:
composer update && npm i && npx wdio tests/selenium/wdio.conf.js --spec tests/selenium/specs/user.js --mochaOpts.grep preferences --mochaOpts.timeout 50000

Details

Related Gerrit Patches:

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 19 2018, 4:28 PM
git bisect start

git bisect bad 38ab0b0c4cb041d9c4ff0ca4b62656d2768df79a

git bisect good e90eafdf6107d4e49c9c20f6310d1d6ee5f5c47f
Bisecting: 379 revisions left to test after this (roughly 9 steps)
[2c16290785cb2b2acee9ae8f4af64fb2b943b07e] Add @covers tags to page tests

...

git bisect run bash -c 'composer update && npm i && npx wdio tests/selenium/wdio.conf.js --spec tests/selenium/specs/user.js --mochaOpts.grep preferences --mochaOpts.timeout 50000'

...

[chrome #0-0] Session ID: 722f501e981cd006b2e667110bf5179b
[chrome #0-0] Spec: /Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/tests/selenium/specs/user.js
[chrome #0-0] Running: chrome
[chrome #0-0]
[chrome #0-0]   User
[chrome #0-0]
[chrome #0-0]   User
[chrome #0-0]       1) should be able to change preferences
[chrome #0-0]
[chrome #0-0]
[chrome #0-0] 1 failing (11s)
[chrome #0-0]
[chrome #0-0] 1) User should be able to change preferences:
[chrome #0-0] '' == '0.47688065784075495'
[chrome #0-0] AssertionError [ERR_ASSERTION]: '' == '0.47688065784075495'
[chrome #0-0]     at Context.<anonymous> (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/tests/selenium/specs/user.js:65:10)
[chrome #0-0]     at new Promise (<anonymous>)
[chrome #0-0]

d5aa846d84e33967f086ef90a532243823b7b4a3 is the first bad commit
commit d5aa846d84e33967f086ef90a532243823b7b4a3
Author: Aaron Schulz <aschulz@wikimedia.org>
Date:   Fri Dec 8 13:36:25 2017 -0800

    Replace cpPosTime cookie/parameter with cpPosIndex
    
    This handles multi-DB transactions properly, instead of causing wait
    timeouts in the WaitConditionLoop. It also is more correct in using
    a counter instead of relying on wall clocks.
    
    In addition:
    * Refactor related code in MediaWiki.php to be comprehensible.
    * Always send the cookie even the "remote wiki redirect" case.
    * Renamed ChronologyProtector field and constant to avoid any
      confusion of "wait for server X to reach Y" with "wait for Y
      to show up in position store".
    * Add an "asOfTime" field to the position keys for debugging.
    
    Bug: T182322
    Change-Id: I5c73cd07eaf664f02ba00c38fab9f49b609f4284

:040000 040000 bde198cb44c7689101741f67a1cb72139ed066fd 016e4c7600dbd00d1c73e3cbc7b95a1df4438468 M	includes
:040000 040000 bd1ea0ba5a2e2e6bcad004606f59ffdda2035f0e a2b561d689e9137efb6db2b56f23a6ce5a514368 M	tests
bisect run success

Looks like 396546 caused the problem.

aaron added a comment.Jan 26 2018, 8:00 PM

Do these tests actually used replication or is it singe DB server? Header logs would also be useful.

Change 407185 had a related patch set uploaded (by Aaron Schulz; owner: Aaron Schulz):
[mediawiki/core@master] Make interim WAN cache key deactivation logic broader

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

Change 407185 merged by jenkins-bot:
[mediawiki/core@master] Make interim WAN cache key deactivation logic broader

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

aaron closed this task as Resolved.Feb 6 2018, 11:56 PM
aaron claimed this task.

Verified by local selenium test runs (passes with the fix and fails without the fix).