Page MenuHomePhabricator

"On Initial view -> Will not switch to edit mode if the column clicked is not selected" test is flaky
Closed, ResolvedPublic

Description

The named test has flaked 21 times, thus appearing in the flaky test dashboard.

https://releng-data.wmcloud.org/-/dashboards/selenium/last-thirty

Test reference:

https://integration.wikimedia.org/ci/job/selenium-daily-beta-TwoColConflict/2274/

Purpose of this ticket:

Investigate the flakiness - Is the test still flaky? Does it happen locally? What is the cause of the flakiness?

Based on those answers, plan and implement a resolution for the problematic test.

Failure from most recent flake :

Error: Can't call click on element with selector ".mw-twocolconflict-split-selection-row div:nth-child(1) span" because element wasn't found
    at async Context.<anonymous> (/src/tests/selenium/specs/editmerge.js:93:4)

Event Timeline

most recent reference test: https://integration.wikimedia.org/ci/job/selenium-daily-beta-TwoColConflict/2337/

Error details

Can't call click on element with selector ".mw-twocolconflict-split-selection-row div:nth-child(1) span" because element wasn't found

Standard output

COMMAND: navigateTo - {"url":"https://en.wikipedia.beta.wmcloud.org/w/index.php?action=edit&vehidebetadialog=1&hidewelcomedialog=1&title=conflict-title-0.9242675857996017-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n"}
RESULT: undefined
COMMAND: executeScript - {"script":"return (() => document.readyState === 'complete').apply(null, arguments)","args":[]}
RESULT: undefined
COMMAND: findElement - {"using":"css selector","value":"#wpTextbox1"}
RESULT: undefined
COMMAND: findElements - {"using":"css selector","value":"#wpTextbox1"}
RESULT: undefined
COMMAND: findElement - {"using":"css selector","value":"#wpTextbox1"}
RESULT: undefined
COMMAND: elementClear - {"elementId":"ELEMENT-94"}
RESULT: undefined
COMMAND: elementSendKeys - {"elementId":"ELEMENT-94","text":"Line<span>1</span>\n\nChange <span lang=\"en\">B</span>"}
RESULT: undefined
COMMAND: findElement - {"using":"css selector","value":"#wpSave"}
RESULT: undefined
COMMAND: elementClick - {"elementId":"ELEMENT-95"}
RESULT: undefined
COMMAND: executeScript - {"script":"return (( arg ) => typeof mw !== 'undefined' && mw.loader.getState( arg.name ) === arg.status).apply(null, arguments)","args":[{"status":"ready","name":"ext.TwoColConflict.SplitJs"}]}
RESULT: undefined
COMMAND: executeScript - {"script":"return (( arg ) => typeof mw !== 'undefined' && mw.loader.getState( arg.name ) === arg.status).apply(null, arguments)","args":[{"status":"ready","name":"ext.TwoColConflict.SplitJs"}]}
RESULT: undefined
COMMAND: findElement - {"using":"css selector","value":".mw-twocolconflict-split-selection-row div:nth-child(1) span"}
RESULT: undefined
COMMAND: findElements - {"using":"css selector","value":".mw-twocolconflict-split-selection-row div:nth-child(1) span"}
RESULT: undefined
COMMAND: findElements - {"using":"css selector","value":".mw-twocolconflict-split-selection-row div:nth-child(1) span"}
RESULT: undefined
COMMAND: findElements - {"using":"css selector","value":".mw-twocolconflict-split-selection-row div:nth-child(1) span"}
RESULT: undefined
COMMAND: findElements - {"using":"css selector","value":".mw-twocolconflict-split-selection-row div:nth-child(1) span"}
RESULT: undefined
COMMAND: findElements - {"using":"css selector","value":".mw-twocolconflict-split-selection-row div:nth-child(1) span"}
RESULT: undefined
COMMAND: findElements - {"using":"css selector","value":".mw-twocolconflict-split-selection-row div:nth-child(1) span"}
RESULT: undefined
COMMAND: findElements - {"using":"css selector","value":".mw-twocolconflict-split-selection-row div:nth-child(1) span"}
RESULT: undefined
COMMAND: findElements - {"using":"css selector","value":".mw-twocolconflict-split-selection-row div:nth-child(1) span"}
RESULT: undefined
COMMAND: findElements - {"using":"css selector","value":".mw-twocolconflict-split-selection-row div:nth-child(1) span"}
RESULT: undefined
COMMAND: findElements - {"using":"css selector","value":".mw-twocolconflict-split-selection-row div:nth-child(1) span"}
RESULT: undefined
COMMAND: takeScreenshot - {}
RESULT: undefined

Standard error

Error: Can't call click on element with selector ".mw-twocolconflict-split-selection-row div:nth-child(1) span" because element wasn't found
    at async Context.<anonymous> (/src/tests/selenium/specs/editmerge.js:93:4)
vaughnwalters renamed this task from "On Initial view -> Will not switch to edit mode" test is flaky to "On Initial view -> Will not switch to edit mode if the column clicked is not selected" test is flaky.Jan 29 2026, 11:05 PM

Change #1235165 had a related patch set uploaded (by Vaughn Walters; author: Vaughn Walters):

[mediawiki/extensions/TwoColConflict@master] selenium: Fixing test flake

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

In isolation:
Test passes 100/100 on local
Test passes 100/100 in CI

Entire file containing the test (editmerge.js):
Test passes 75/75 on CI before timing out

Entire test suite:
Test passes 64/64 in CI before timing out


From local when running against betacluster 100 times there were two failures, but not the one that was present on the flaky test report.

Execution of 1 workers started at 2026-01-30T23:26:51.502Z

[0-0] RUNNING in chrome - /tests/selenium/specs/editmerge.js
[0-0] Error in "TwoColConflict EditUi.on initial view."before all" hook for "will not switch to edit mode if the column clicked is not selected""
Error: element ("#wpTextbox1") still not existing after 5000ms
    at async EditConflictPage.createConflict (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/tests/selenium/pageobjects/editconflict.page.js:256:3)
    at async EditConflictPage.showSimpleConflict (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/tests/selenium/pageobjects/editconflict.page.js:213:3)
    at async Context.<anonymous> (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/tests/selenium/specs/editmerge.js:17:4)
[0-0] RETRYING in chrome - /tests/selenium/specs/editmerge.js
[0-0] RUNNING in chrome - /tests/selenium/specs/editmerge.js
[0-0] PASSED in chrome - /tests/selenium/specs/editmerge.js (1 retries)

 "spec" Reporter:
------------------------------------------------------------------
[Chrome Headless 144.0.0.0 darwin #0-0] Running: Chrome Headless (v144.0.0.0) on darwin
[Chrome Headless 144.0.0.0 darwin #0-0] Session ID: e90def01-2ea5-496f-b549-afc2ff006a4e
[Chrome Headless 144.0.0.0 darwin #0-0]
[Chrome Headless 144.0.0.0 darwin #0-0] » /tests/selenium/specs/editmerge.js
[Chrome Headless 144.0.0.0 darwin #0-0] TwoColConflict EditUi
[Chrome Headless 144.0.0.0 darwin #0-0]     on initial view
[Chrome Headless 144.0.0.0 darwin #0-0]        ✖ "before all" hook for on initial view
[Chrome Headless 144.0.0.0 darwin #0-0]
[Chrome Headless 144.0.0.0 darwin #0-0] 1 failing (12.3s)
[Chrome Headless 144.0.0.0 darwin #0-0]
[Chrome Headless 144.0.0.0 darwin #0-0] 1) on initial view "before all" hook for on initial view
[Chrome Headless 144.0.0.0 darwin #0-0] element ("#wpTextbox1") still not existing after 5000ms
[Chrome Headless 144.0.0.0 darwin #0-0] Error: element ("#wpTextbox1") still not existing after 5000ms
[Chrome Headless 144.0.0.0 darwin #0-0]     at async EditConflictPage.createConflict (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/tests/selenium/pageobjects/editconflict.page.js:256:3)
[Chrome Headless 144.0.0.0 darwin #0-0]     at async EditConflictPage.showSimpleConflict (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/tests/selenium/pageobjects/editconflict.page.js:213:3)
[Chrome Headless 144.0.0.0 darwin #0-0]     at async Context.<anonymous> (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/tests/selenium/specs/editmerge.js:17:4)

and also the mwbot error, which needs wdio-mediawiki upgraded to 6.0.0 so mwbot can be removed:

0-0] RUNNING in chrome - /tests/selenium/specs/editmerge.js
[0-0] [17:11:53] [E] [MWBOT] Login failed: User-0.5235439919609335-Iñtërnâtiônàlizætiøn@https://en.wikipedia.beta.wmcloud.org/w
[0-0] Error in "TwoColConflict EditUi.on initial view."before all" hook for "will not switch to edit mode if the column clicked is not selected""
Error: Could not login: Failed
    at /Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/mwbot/src/index.js:335:31
    at tryCatcher (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/bluebird/js/release/async.js:102:5)
    at Async.drainQueues (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/bluebird/js/release/async.js:15:14)
    at process.processImmediate (node:internal/timers:485:21)
[0-0] RETRYING in chrome - /tests/selenium/specs/editmerge.js
[0-0] RUNNING in chrome - /tests/selenium/specs/editmerge.js
[0-0] PASSED in chrome - /tests/selenium/specs/editmerge.js (1 retries)

 "spec" Reporter:
------------------------------------------------------------------
[Chrome Headless 144.0.0.0 darwin #0-0] Running: Chrome Headless (v144.0.0.0) on darwin
[Chrome Headless 144.0.0.0 darwin #0-0] Session ID: 9c2cc3a2-7aec-4b99-bd21-d868f452b3ff
[Chrome Headless 144.0.0.0 darwin #0-0]
[Chrome Headless 144.0.0.0 darwin #0-0] » /tests/selenium/specs/editmerge.js
[Chrome Headless 144.0.0.0 darwin #0-0] TwoColConflict EditUi
[Chrome Headless 144.0.0.0 darwin #0-0]     on initial view
[Chrome Headless 144.0.0.0 darwin #0-0]        ✖ "before all" hook for on initial view
[Chrome Headless 144.0.0.0 darwin #0-0]
[Chrome Headless 144.0.0.0 darwin #0-0] 1 failing (10.7s)
[Chrome Headless 144.0.0.0 darwin #0-0]
[Chrome Headless 144.0.0.0 darwin #0-0] 1) on initial view "before all" hook for on initial view
[Chrome Headless 144.0.0.0 darwin #0-0] Could not login: Failed
[Chrome Headless 144.0.0.0 darwin #0-0] Error: Could not login: Failed
[Chrome Headless 144.0.0.0 darwin #0-0]     at /Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/mwbot/src/index.js:335:31
[Chrome Headless 144.0.0.0 darwin #0-0]     at tryCatcher (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/bluebird/js/release/util.js:16:23)
[Chrome Headless 144.0.0.0 darwin #0-0]     at Promise._settlePromiseFromHandler (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/bluebird/js/release/promise.js:547:31)
[Chrome Headless 144.0.0.0 darwin #0-0]     at Promise._settlePromise (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/bluebird/js/release/promise.js:604:18)
[Chrome Headless 144.0.0.0 darwin #0-0]     at Promise._settlePromise0 (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/bluebird/js/release/promise.js:649:10)
[Chrome Headless 144.0.0.0 darwin #0-0]     at Promise._settlePromises (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/bluebird/js/release/promise.js:729:18)
[Chrome Headless 144.0.0.0 darwin #0-0]     at _drainQueueStep (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/bluebird/js/release/async.js:93:12)
[Chrome Headless 144.0.0.0 darwin #0-0]     at _drainQueue (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/bluebird/js/release/async.js:86:9)
[Chrome Headless 144.0.0.0 darwin #0-0]     at Async._drainQueues (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/bluebird/js/release/async.js:102:5)
[Chrome Headless 144.0.0.0 darwin #0-0]     at Async.drainQueues (/Users/vaughnwalters/workspace/gerrit/mediawiki/extensions/TwoColConflict/node_modules/bluebird/js/release/async.js:15:14)
[Chrome Headless 144.0.0.0 darwin #0-0]     at process.processImmediate (node:internal/timers:485:21)

The issues in this test suite are larger than just this one flaky test. I created T416633 as a follow up from the findings in this task.

This was the last stable build, which was June 15, 2025:
https://integration.wikimedia.org/ci/job/selenium-daily-beta-TwoColConflict/lastStableBuild/

And this was the first time after that the the test suite flaked and it has not passed since then.
https://integration.wikimedia.org/ci/job/selenium-daily-beta-TwoColConflict/2351/

I have added waits and logging to the test in this task Will not switch to edit mode if the column clicked is not selected and it is passing now in my local runs against betacluster, but we need to look at what is causing the more widespread and consistent failure for 7+ months. After this fix is merged, we can look at T416633.

Who are we waiting for a code review from? The owner of the test suite?

Who are we waiting for a code review from? The owner of the test suite?

Owner of the test suite or anyone who contributes to TwoColConflict extension. One user was auto added and I added a few others who have contributed to the repo. I'm not sure who owns this extension though.

I'm not sure who owns this extension though.

Per https://www.mediawiki.org/wiki/Developers/Maintainers it is maintained by WMDE Engineering.

Hi @Lina_Farid_WMDE, Lydia pointed us in your team's direction. Do you think the team could help us out here?

Hi, Tech Wishes dev here! After a brief chat, we would recommend disabling the entire suite for now. We've noticed the flakiness as well and it counteracts any value that might be gotten from having the tests. I'm happy to do that if you agree that it's the right direction to go in.

Hi, Tech Wishes dev here! After a brief chat, we would recommend disabling the entire suite for now. We've noticed the flakiness as well and it counteracts any value that might be gotten from having the tests. I'm happy to do that if you agree that it's the right direction to go in.

Hello hello @awight, yeah I think if it's not adding value then that is fine with me. Let me know when they are disabled and we can close this ticket, and I will go ahead and mark https://gerrit.wikimedia.org/r/c/mediawiki/extensions/TwoColConflict/+/1235165 as abandoned as well then. Thank you!

Change #1235165 abandoned by Vaughn Walters:

[mediawiki/extensions/TwoColConflict@master] selenium: Fixing test flake for "Will not switch to edit mode if the column clicked is not selected";

Reason:

Test suite is being disabled by Tech Wishes team

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

Change #1251277 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/TwoColConflict@master] Selenium: Removing some selenium tests

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

Change #1251277 merged by jenkins-bot:

[mediawiki/extensions/TwoColConflict@master] Selenium: Removing some selenium tests

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

WMDE-Fisch subscribed.

I hope it's fine now. :-)