Page MenuHomePhabricator

Selenium test error: Content Editable.should load when an url is opened @daily ("Execution context was destroyed")
Closed, ResolvedPublic

Description

I have seen this error several times in GrowthExperiments builds (example https://integration.wikimedia.org/ci/job/wmf-quibble-selenium-php72-docker/156051/console#console-section-16):

10:18:23 Execution of 1 workers started at 2022-06-16T08:18:23.288Z
10:18:23 
10:18:23 2022-06-16T08:18:23.291Z INFO @wdio/cli:launcher: Run onPrepare hook
10:18:23 2022-06-16T08:18:23.293Z INFO @wdio/cli:launcher: Run onWorkerStart hook
10:18:23 2022-06-16T08:18:23.294Z INFO @wdio/local-runner: Start worker 0-0 with arg: tests/selenium/wdio.conf.js
10:18:23 [0-0] 2022-06-16T08:18:23.863Z INFO @wdio/local-runner: Run worker command: run
10:18:23 [0-0] RUNNING in chrome - /tests/selenium/specs/content_editable.js
10:18:24 [0-0] 2022-06-16T08:18:24.092Z INFO devtools:puppeteer: Initiate new session using the DevTools protocol
10:18:24 [0-0] 2022-06-16T08:18:24.093Z INFO devtools: Launch Google Chrome with flags: --enable-automation --disable-popup-blocking --disable-extensions --disable-background-networking --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-sync --metrics-recording-only --disable-default-apps --mute-audio --no-first-run --no-default-browser-check --disable-hang-monitor --disable-prompt-on-repost --disable-client-side-phishing-detection --password-store=basic --use-mock-keychain --disable-component-extensions-with-background-pages --disable-breakpad --disable-dev-shm-usage --disable-ipc-flooding-protection --disable-renderer-backgrounding --force-fieldtrials=*BackgroundTracing/default/ --enable-features=NetworkService,NetworkServiceInProcess --disable-features=site-per-process,TranslateUI,BlinkGenPropertyTrees --window-position=0,0 --window-size=1200,900 --enable-automation --no-sandbox
10:18:24 [0-0] 2022-06-16T08:18:25.204Z INFO devtools: Connect Puppeteer with browser on port 44799
10:18:25 [0-0] 2022-06-16T08:18:25.350Z INFO devtools: COMMAND deleteAllCookies()
10:18:25 [0-0] 2022-06-16T08:18:25.353Z INFO devtools: RESULT null
10:18:25 [0-0] 2022-06-16T08:18:25.359Z INFO devtools: COMMAND findElement("css selector", "#wpName1")
10:18:25 [0-0] 2022-06-16T08:18:25.360Z INFO devtools: COMMAND navigateTo("http://127.0.0.1:9413//index.php?title=Special%3AUserLogin")
10:18:25 [0-0] 2022-06-16T08:18:25.372Z INFO devtools: RESULT Error: Element with selector "#wpName1" not found
10:18:25 [0-0]     at DevToolsDriver.findElement (/workspace/src/extensions/VisualEditor/node_modules/devtools/build/utils.js:104:16)
10:18:25 [0-0]     at processTicksAndRejections (internal/process/task_queues.js:95:5)
10:18:25 [0-0]     at async Browser.wrappedCommand (/workspace/src/extensions/VisualEditor/node_modules/devtools/build/devtoolsdriver.js:102:26)
10:18:25 [0-0]     at async Browser.wrapCommandFn (/workspace/src/extensions/VisualEditor/node_modules/@wdio/utils/build/shim.js:131:29)
10:18:25 [0-0]     at async Browser.$ (/workspace/src/extensions/VisualEditor/node_modules/webdriverio/build/commands/browser/$.js:88:17)
10:18:25 [0-0]     at async Browser.wrapCommandFn (/workspace/src/extensions/VisualEditor/node_modules/@wdio/utils/build/shim.js:131:29)
10:18:25 [0-0]     at async LoginPage.login (/workspace/src/extensions/VisualEditor/node_modules/wdio-mediawiki/LoginPage.js:17:3)
10:18:25 [0-0]     at async LoginPage.loginAdmin (/workspace/src/extensions/VisualEditor/node_modules/wdio-mediawiki/LoginPage.js:23:3)
10:18:25 [0-0]     at async Context.<anonymous> (/workspace/src/extensions/VisualEditor/tests/selenium/specs/content_editable.js:15:3)
10:18:25 [0-0] 2022-06-16T08:18:26.245Z INFO devtools: RESULT null
10:18:26 [0-0] 2022-06-16T08:18:26.342Z INFO devtools: COMMAND findElements("css selector", "#wpName1")
10:18:26 [0-0] 2022-06-16T08:18:26.412Z INFO devtools: RESULT [ { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-1' } ]
10:18:26 [0-0] 2022-06-16T08:18:26.430Z INFO devtools: COMMAND findElement("css selector", "#wpName1")
10:18:26 [0-0] 2022-06-16T08:18:26.435Z INFO devtools: RESULT { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-2' }
10:18:26 [0-0] 2022-06-16T08:18:26.453Z INFO devtools: COMMAND elementClear("ELEMENT-2")
10:18:26 [0-0] 2022-06-16T08:18:26.467Z INFO devtools: RESULT null
10:18:26 [0-0] 2022-06-16T08:18:26.480Z INFO devtools: COMMAND elementSendKeys("ELEMENT-2", "WikiAdmin")
10:18:26 [0-0] 2022-06-16T08:18:26.665Z INFO devtools: RESULT null
10:18:26 [0-0] 2022-06-16T08:18:26.686Z INFO devtools: COMMAND findElement("css selector", "#wpPassword1")
10:18:26 [0-0] 2022-06-16T08:18:26.700Z INFO devtools: RESULT { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-3' }
10:18:26 [0-0] 2022-06-16T08:18:26.718Z INFO devtools: COMMAND elementClear("ELEMENT-3")
10:18:26 [0-0] 2022-06-16T08:18:26.727Z INFO devtools: RESULT null
10:18:26 [0-0] 2022-06-16T08:18:26.734Z INFO devtools: COMMAND elementSendKeys("ELEMENT-3", "testwikijenkinspass")
10:18:26 [0-0] 2022-06-16T08:18:26.948Z INFO devtools: RESULT null
10:18:26 [0-0] 2022-06-16T08:18:26.951Z INFO devtools: COMMAND findElement("css selector", "#wpLoginAttempt")
10:18:26 [0-0] 2022-06-16T08:18:26.955Z INFO devtools: RESULT { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-4' }
10:18:26 [0-0] 2022-06-16T08:18:26.961Z INFO devtools: COMMAND elementClick("ELEMENT-4")
10:18:26 [0-0] 2022-06-16T08:18:27.014Z INFO devtools: RESULT null
10:18:27 [0-0] 2022-06-16T08:18:28.359Z INFO devtools: COMMAND executeAsyncScript(<fn>, <object>)
10:18:28 [0-0] 2022-06-16T08:18:28.365Z INFO devtools: COMMAND navigateTo("http://127.0.0.1:9413//index.php?veaction=edit&cxhidebetapopup=1&hidewelcomedialog=1&vehidebetadialog=1&title=0.856375444021676-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n")
10:18:28 [0-0] ProtocolError in "Content Editable.should load when an url is opened @daily"
10:18:28 Protocol error (Runtime.callFunctionOn): Execution context was destroyed.
10:18:28 ProtocolError: Protocol error (Runtime.callFunctionOn): Execution context was destroyed.
10:18:28     at /workspace/src/extensions/VisualEditor/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:230:24
10:18:28     at new Promise (<anonymous>)
10:18:28     at CDPSession.send (/workspace/src/extensions/VisualEditor/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:226:16)
10:18:28     at ExecutionContext._evaluateInternal (/workspace/src/extensions/VisualEditor/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:204:50)
10:18:28     at ExecutionContext.evaluate (/workspace/src/extensions/VisualEditor/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:110:27)
10:18:28     at ElementHandle.evaluate (/workspace/src/extensions/VisualEditor/node_modules/puppeteer-core/lib/cjs/puppeteer/common/JSHandle.js:107:46)
10:18:28     at ElementHandle.$eval (/workspace/src/extensions/VisualEditor/node_modules/puppeteer-core/lib/cjs/puppeteer/common/JSHandle.js:810:44)
10:18:28     at processTicksAndRejections (internal/process/task_queues.js:95:5)
10:18:28     at async DevToolsDriver.executeAsyncScript (/workspace/src/extensions/VisualEditor/node_modules/devtools/build/commands/executeAsyncScript.js:31:20)
10:18:28     at async Browser.wrappedCommand (/workspace/src/extensions/VisualEditor/node_modules/devtools/build/devtoolsdriver.js:102:26)
10:18:28 [0-0] 2022-06-16T08:18:28.903Z INFO devtools: RESULT null
10:18:28 [0-0] 2022-06-16T08:18:28.933Z INFO devtools: COMMAND takeScreenshot()
10:18:28 [0-0] 2022-06-16T08:18:28.934Z INFO devtools: COMMAND deleteAllCookies()
10:18:28 [0-0] 2022-06-16T08:18:29.047Z INFO devtools: RESULT null
10:18:29 [0-0] 2022-06-16T08:18:29.161Z INFO devtools: RESULT iVBORw0KGgoAAAANSUhEUgAABKEAAAMQCAYAAAD/9nZ5AAAAAXNSR0IArs4c6...
10:18:29 [0-0] 2022-06-16T08:18:29.163Z INFO devtools: COMMAND findElement("css selector", "#wpName1")
10:18:29 [0-0] 2022-06-16T08:18:29.163Z INFO devtools: COMMAND navigateTo("http://127.0.0.1:9413//index.php?title=Special%3AUserLogin")
10:18:29 [0-0] 2022-06-16T08:18:29.579Z INFO devtools: RESULT null
10:18:29 [0-0] 2022-06-16T08:18:29.628Z INFO devtools: COMMAND findElement("css selector", "#wpName1")
10:18:29 [0-0] 2022-06-16T08:18:29.642Z INFO devtools: RESULT { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-5' }
10:18:29 [0-0] 2022-06-16T08:18:29.648Z INFO devtools: COMMAND elementClear("ELEMENT-5")
10:18:29 [0-0] 2022-06-16T08:18:29.665Z INFO devtools: RESULT null
10:18:29 [0-0] 2022-06-16T08:18:29.669Z INFO devtools: COMMAND elementSendKeys("ELEMENT-5", "WikiAdmin")
10:18:29 [0-0] 2022-06-16T08:18:29.757Z INFO devtools: RESULT null
10:18:29 [0-0] 2022-06-16T08:18:29.763Z INFO devtools: COMMAND findElement("css selector", "#wpPassword1")
10:18:29 [0-0] 2022-06-16T08:18:29.765Z INFO devtools: RESULT { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-6' }
10:18:29 [0-0] 2022-06-16T08:18:29.779Z INFO devtools: COMMAND elementClear("ELEMENT-6")
10:18:29 [0-0] 2022-06-16T08:18:29.785Z INFO devtools: RESULT null
10:18:29 [0-0] 2022-06-16T08:18:29.791Z INFO devtools: COMMAND elementSendKeys("ELEMENT-6", "testwikijenkinspass")
10:18:29 [0-0] 2022-06-16T08:18:29.968Z INFO devtools: RESULT null
10:18:29 [0-0] 2022-06-16T08:18:29.992Z INFO devtools: COMMAND findElement("css selector", "#wpLoginAttempt")
10:18:30 [0-0] 2022-06-16T08:18:29.995Z INFO devtools: RESULT { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-7' }
10:18:30 [0-0] 2022-06-16T08:18:30.006Z INFO devtools: COMMAND elementClick("ELEMENT-7")
10:18:30 [0-0] 2022-06-16T08:18:30.060Z INFO devtools: RESULT null
10:18:30 [0-0] 2022-06-16T08:18:30.871Z INFO devtools: COMMAND executeAsyncScript(<fn>, <object>)
10:18:30 [0-0] 2022-06-16T08:18:30.878Z INFO devtools: COMMAND navigateTo("http://127.0.0.1:9413//index.php?veaction=edit&cxhidebetapopup=1&hidewelcomedialog=1&vehidebetadialog=1&title=0.12735616245513293-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n")
10:18:30 [0-0] 2022-06-16T08:18:31.269Z INFO devtools: RESULT null
10:18:31 [0-0] 2022-06-16T08:18:31.325Z INFO devtools: COMMAND executeAsyncScript(<fn>, <object>)
10:18:31 [0-0] 2022-06-16T08:18:32.162Z INFO devtools: COMMAND findElement("css selector", ".ve-ce-rootNode[role="textbox"]")
10:18:32 [0-0] 2022-06-16T08:18:32.174Z INFO devtools: RESULT { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-8' }
10:18:32 [0-0] 2022-06-16T08:18:32.199Z INFO devtools: COMMAND elementClear("ELEMENT-8")
10:18:32 [0-0] 2022-06-16T08:18:32.208Z INFO devtools: RESULT null
10:18:32 [0-0] 2022-06-16T08:18:32.216Z INFO devtools: COMMAND elementSendKeys("ELEMENT-8", "0.09364753877939003-Iñtërnâtiônàlizætiøn")
10:18:32 [0-0] 2022-06-16T08:18:32.639Z INFO devtools: RESULT null
10:18:32 [0-0] 2022-06-16T08:18:32.644Z INFO devtools: COMMAND findElement("css selector", ".ve-ce-rootNode[role="textbox"]")
10:18:33 [0-0] 2022-06-16T08:18:32.646Z INFO devtools: RESULT { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-9' }
10:18:33 [0-0] 2022-06-16T08:18:32.653Z INFO devtools: COMMAND getElementText("ELEMENT-9")
10:18:33 [0-0] 2022-06-16T08:18:32.659Z INFO devtools: RESULT 0.09364753877939003-Iñtërnâtiônàlizætiøn
10:18:33 [0-0] 2022-06-16T08:18:32.663Z INFO devtools: COMMAND deleteSession()
10:18:33 [0-0] 2022-06-16T08:18:32.667Z INFO devtools: RESULT null
10:18:33 [0-0] 2022-06-16T08:18:32.668Z INFO devtools: Launch Google Chrome with flags: --enable-automation --disable-popup-blocking --disable-extensions --disable-background-networking --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-sync --metrics-recording-only --disable-default-apps --mute-audio --no-first-run --no-default-browser-check --disable-hang-monitor --disable-prompt-on-repost --disable-client-side-phishing-detection --password-store=basic --use-mock-keychain --disable-component-extensions-with-background-pages --disable-breakpad --disable-dev-shm-usage --disable-ipc-flooding-protection --disable-renderer-backgrounding --force-fieldtrials=*BackgroundTracing/default/ --enable-features=NetworkService,NetworkServiceInProcess --disable-features=site-per-process,TranslateUI,BlinkGenPropertyTrees --window-position=0,0 --window-size=1200,900 --enable-automation --no-sandbox
10:18:33 [0-0] 2022-06-16T08:18:33.285Z INFO devtools: Connect Puppeteer with browser on port 40957
10:18:33 [0-0] 2022-06-16T08:18:33.560Z INFO devtools: COMMAND takeScreenshot()
10:18:33 [0-0] 2022-06-16T08:18:33.561Z INFO devtools: COMMAND deleteAllCookies()
10:18:33 [0-0] 2022-06-16T08:18:33.581Z INFO devtools: RESULT null
10:18:33 [0-0] 2022-06-16T08:18:33.584Z INFO devtools: COMMAND findElement("css selector", "#wpName1")
10:18:33 [0-0] 2022-06-16T08:18:33.585Z INFO devtools: COMMAND navigateTo("http://127.0.0.1:9413//index.php?title=Special%3AUserLogin")
10:18:33 [0-0] 2022-06-16T08:18:33.663Z INFO devtools: RESULT iVBORw0KGgoAAAANSUhEUgAABLAAAAMQCAYAAAA3mpyvAAAAAXNSR0IArs4c6...
10:18:33 [0-0] 2022-06-16T08:18:34.378Z INFO devtools: RESULT null
10:18:34 [0-0] 2022-06-16T08:18:34.471Z INFO devtools: COMMAND findElement("css selector", "#wpName1")
10:18:34 [0-0] 2022-06-16T08:18:34.505Z INFO devtools: RESULT { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-10' }
10:18:34 [0-0] 2022-06-16T08:18:34.525Z INFO devtools: COMMAND elementClear("ELEMENT-10")
10:18:34 [0-0] 2022-06-16T08:18:34.530Z INFO devtools: RESULT null
10:18:34 [0-0] 2022-06-16T08:18:34.533Z INFO devtools: COMMAND elementSendKeys("ELEMENT-10", "WikiAdmin")
10:18:34 [0-0] 2022-06-16T08:18:34.620Z INFO devtools: RESULT null
10:18:34 [0-0] 2022-06-16T08:18:34.628Z INFO devtools: COMMAND findElement("css selector", "#wpPassword1")
10:18:34 [0-0] 2022-06-16T08:18:34.629Z INFO devtools: RESULT { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-11' }
10:18:34 [0-0] 2022-06-16T08:18:34.641Z INFO devtools: COMMAND elementClear("ELEMENT-11")
10:18:34 [0-0] 2022-06-16T08:18:34.651Z INFO devtools: RESULT null
10:18:34 [0-0] 2022-06-16T08:18:34.729Z INFO devtools: COMMAND elementSendKeys("ELEMENT-11", "testwikijenkinspass")
10:18:34 [0-0] 2022-06-16T08:18:34.916Z INFO devtools: RESULT null
10:18:34 [0-0] 2022-06-16T08:18:34.921Z INFO devtools: COMMAND findElement("css selector", "#wpLoginAttempt")
10:18:34 [0-0] 2022-06-16T08:18:34.923Z INFO devtools: RESULT { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-12' }
10:18:34 [0-0] 2022-06-16T08:18:34.945Z INFO devtools: COMMAND elementClick("ELEMENT-12")
10:18:34 [0-0] 2022-06-16T08:18:35.001Z INFO devtools: RESULT null
10:18:35 [0-0] 2022-06-16T08:18:36.349Z INFO devtools: COMMAND executeAsyncScript(<fn>, <object>)
10:18:36 [0-0] 2022-06-16T08:18:36.355Z INFO devtools: COMMAND navigateTo("http://127.0.0.1:9413//index.php?veaction=edit&cxhidebetapopup=1&hidewelcomedialog=1&vehidebetadialog=1&title=0.11000668597125896-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n")
10:18:36 [0-0] 2022-06-16T08:18:36.820Z INFO devtools: RESULT null
10:18:36 [0-0] 2022-06-16T08:18:36.914Z INFO devtools: COMMAND executeAsyncScript(<fn>, <object>)
10:18:36 [0-0] 2022-06-16T08:18:37.852Z INFO devtools: COMMAND findElement("css selector", ".ve-ce-rootNode[role="textbox"]")
10:18:37 [0-0] 2022-06-16T08:18:37.855Z INFO devtools: RESULT { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-13' }
10:18:37 [0-0] 2022-06-16T08:18:37.889Z INFO devtools: COMMAND elementClear("ELEMENT-13")
10:18:37 [0-0] 2022-06-16T08:18:37.934Z INFO devtools: RESULT null
10:18:37 [0-0] 2022-06-16T08:18:37.943Z INFO devtools: COMMAND elementSendKeys("ELEMENT-13", "0.7967563851762192-Iñtërnâtiônàlizætiøn")
10:18:37 [0-0] 2022-06-16T08:18:38.304Z INFO devtools: RESULT null
10:18:38 [0-0] 2022-06-16T08:18:38.308Z INFO devtools: COMMAND findElement("css selector", ".ve-ui-toolbar-saveButton")
10:18:38 [0-0] 2022-06-16T08:18:38.309Z INFO devtools: RESULT { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-14' }
10:18:38 [0-0] 2022-06-16T08:18:38.313Z INFO devtools: COMMAND elementClick("ELEMENT-14")
10:18:38 [0-0] 2022-06-16T08:18:38.399Z INFO devtools: RESULT null
10:18:38 [0-0] 2022-06-16T08:18:38.442Z INFO devtools: COMMAND findElement("css selector", ".ve-ui-overlay-global .oo-ui-processDialog-actions-primary")
10:18:38 [0-0] 2022-06-16T08:18:38.449Z INFO devtools: RESULT { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-15' }
10:18:38 [0-0] 2022-06-16T08:18:38.565Z INFO devtools: COMMAND executeScript(<fn>, <object>)
10:18:38 [0-0] 2022-06-16T08:18:38.604Z INFO devtools: RESULT false
10:18:40 [0-0] 2022-06-16T08:18:38.987Z INFO devtools: COMMAND executeScript(<fn>, <object>)
10:18:40 [0-0] 2022-06-16T08:18:39.017Z INFO devtools: RESULT true
10:18:40 [0-0] 2022-06-16T08:18:39.021Z INFO devtools: COMMAND executeScript(<fn>, <object>)
10:18:40 [0-0] 2022-06-16T08:18:39.027Z INFO devtools: RESULT true
10:18:40 [0-0] 2022-06-16T08:18:39.030Z INFO devtools: COMMAND findElement("css selector", ".ve-ui-overlay-global .oo-ui-processDialog-actions-primary")
10:18:40 [0-0] 2022-06-16T08:18:39.036Z INFO devtools: RESULT { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-16' }
10:18:40 [0-0] 2022-06-16T08:18:39.041Z INFO devtools: COMMAND elementClick("ELEMENT-16")
10:18:40 [0-0] 2022-06-16T08:18:39.092Z INFO devtools: RESULT null
10:18:40 [0-0] 2022-06-16T08:18:39.102Z INFO devtools: COMMAND executeAsyncScript(<fn>, <object>)
10:18:40 [0-0] 2022-06-16T08:18:39.412Z INFO devtools: COMMAND findElement("css selector", "div.mw-notification-content span.oo-ui-labelElement-label")
10:18:40 [0-0] 2022-06-16T08:18:39.415Z INFO devtools: RESULT Error: Element with selector "div.mw-notification-content span.oo-ui-labelElement-label" not found
10:18:40 [0-0]     at DevToolsDriver.findElement (/workspace/src/extensions/VisualEditor/node_modules/devtools/build/utils.js:104:16)
10:18:40 [0-0]     at runMicrotasks (<anonymous>)
10:18:40 [0-0]     at processTicksAndRejections (internal/process/task_queues.js:95:5)
10:18:40 [0-0]     at async Browser.wrappedCommand (/workspace/src/extensions/VisualEditor/node_modules/devtools/build/devtoolsdriver.js:102:26)
10:18:40 [0-0]     at async Browser.wrapCommandFn (/workspace/src/extensions/VisualEditor/node_modules/@wdio/utils/build/shim.js:131:29)
10:18:40 [0-0]     at async Browser.$ (/workspace/src/extensions/VisualEditor/node_modules/webdriverio/build/commands/browser/$.js:88:17)
10:18:40 [0-0]     at async Browser.wrapCommandFn (/workspace/src/extensions/VisualEditor/node_modules/@wdio/utils/build/shim.js:131:29)
10:18:40 [0-0]     at async Context.<anonymous> (/workspace/src/extensions/VisualEditor/tests/selenium/specs/content_editable.js:57:23)
10:18:40 [0-0] 2022-06-16T08:18:39.429Z INFO devtools: COMMAND findElements("css selector", "div.mw-notification-content span.oo-ui-labelElement-label")
10:18:40 [0-0] 2022-06-16T08:18:39.433Z INFO devtools: RESULT []
10:18:40 [0-0] 2022-06-16T08:18:40.185Z INFO devtools: COMMAND findElements("css selector", "div.mw-notification-content span.oo-ui-labelElement-label")
10:18:40 [0-0] 2022-06-16T08:18:40.213Z INFO devtools: RESULT []
10:18:40 [0-0] 2022-06-16T08:18:40.424Z INFO devtools: COMMAND findElements("css selector", "div.mw-notification-content span.oo-ui-labelElement-label")
10:18:40 [0-0] 2022-06-16T08:18:40.427Z INFO devtools: RESULT [ { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-17' } ]
10:18:40 [0-0] 2022-06-16T08:18:40.432Z INFO devtools: COMMAND findElement("css selector", "div.mw-notification-content span.oo-ui-labelElement-label")
10:18:40 [0-0] 2022-06-16T08:18:40.433Z INFO devtools: RESULT { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-18' }
10:18:40 [0-0] 2022-06-16T08:18:40.438Z INFO devtools: COMMAND getElementText("ELEMENT-18")
10:18:40 [0-0] 2022-06-16T08:18:40.444Z INFO devtools: RESULT The page has been created.
10:18:40 [0-0] 2022-06-16T08:18:40.448Z INFO devtools: COMMAND takeScreenshot()
10:18:40 [0-0] 2022-06-16T08:18:40.449Z INFO devtools: COMMAND deleteSession()
10:18:40 [0-0] 2022-06-16T08:18:40.450Z INFO devtools: RESULT null
10:18:40 [0-0] FAILED in chrome - /tests/selenium/specs/content_editable.js
10:18:40 2022-06-16T08:18:40.584Z INFO @wdio/cli:launcher: Run onComplete hook

Event Timeline

@zeljkofilipin, do you know why the @daily annotation ends up getting executed here (Content Editable.should load when an url is opened @daily")? That doesn't seem right to me.

matmarex renamed this task from Selenium test error: Content Editable.should load when an url is opened @daily to Selenium test error: Content Editable.should load when an url is opened @daily ("Execution context was destroyed").Jun 16 2022, 5:20 PM
matmarex subscribed.

I've seen the "Execution context was destroyed" a lot in VisualEditor jobs as well, I don't have examples handy but it felt like it caused failures 10-20% of the time.

Change 806371 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/VisualEditor@master] selenium: Don't reset cookies or login for content_editable test

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

According to https://github.com/puppeteer/puppeteer/issues/1591, the issue is

the issue arises when your script tries to evaluate code in a page that navigates away.
As a result, evaluation fails with the "execution context was destroyed" error: the execution context indeed got destroyed as the page navigated away.

I made a patch to remove the login code, which seems superfluous to the test cases anyway. Maybe that helps.

Change 806371 abandoned by Kosta Harlan:

[mediawiki/extensions/VisualEditor@master] selenium: Don't reset cookies or login for content_editable test

Reason:

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

These tests currently also randomly fail when merging patches in VisualEditor [1]

[1] https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-selenium-docker/124908/console

@zeljkofilipin I suggest that we disable this test until it is more reliable, does that sound OK?

@kostajh: that's a question for @EAkinloose, she's maintaining those tests.

Change 807126 had a related patch set uploaded (by Esther Akinloose; author: Esther Akinloose):

[mediawiki/extensions/VisualEditor@master] WIP selenium: Run test 100 times

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

Change 807557 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/VisualEditor@master] selenium: Disable flaky test

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

kostajh triaged this task as High priority.Jun 22 2022, 2:20 PM

@kostajh: that's a question for @EAkinloose, she's maintaining those tests.

This is causing a lot of build failures for GrowthExperiments and presumably other extensions; I'd like to propose that we disable the test until the issue is found and the test can be re-enabled without causing random build failures.

Change 807557 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] selenium: Disable flaky test

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

807126 runs the failing test (Content Editable.should load when an url is opened @daily) 100 times.

VisualEditor runs two selenium jobs, quibble-vendor-mysql-php72-selenium-docker and wmf-quibble-selenium-php72-docker.

  • quibble-vendor-mysql-php72-selenium-docker failed 9/100.
  • wmf-quibble-selenium-php72-docker failed 8/100.

So not quite 10% but almost there.

We re-run 807126 so it ran all visualeditor selenium tests.

The results were similar, about 10% of the tests failed.

  • quibble-vendor-mysql-php72-selenium-docker: 6/100
  • wmf-quibble-selenium-php72-docker: 10/100

@zeljkofilipin, do you know why the @daily annotation ends up getting executed here (Content Editable.should load when an url is opened @daily")? That doesn't seem right to me.

Sorry, I've just noticed I didn't reply. @daily is just a string added to the test name so we can filter tests that run in the daily job. See package.json#11 and content_editable.js#12.

It doesn't mean the test will not run when code is pushed to gerrit. It just means this test will run in the daily job. Does this answer your question?

I've seen the "Execution context was destroyed" a lot in VisualEditor jobs as well, I don't have examples handy but it felt like it caused failures 10-20% of the time.

That is amazingly correct guess. 😅 It is about 10%, see T310772#8025456 and T310772#8025475.

@zeljkofilipin, do you know why the @daily annotation ends up getting executed here (Content Editable.should load when an url is opened @daily")? That doesn't seem right to me.

Sorry, I've just noticed I didn't reply. @daily is just a string added to the test name so we can filter tests that run in the daily job. See package.json#11 and content_editable.js#12.

It doesn't mean the test will not run when code is pushed to gerrit. It just means this test will run in the daily job. Does this answer your question?

Yes, it does, I wrongly assumed that @daily would mean it is only executed in the daily job context, and not in CI.

Yes, it does, I wrongly assumed that @daily would mean it is only executed in the daily job context, and not in CI.

Now that I think about it more, it is confusing. We've tried to make it simple and to only tag test(s) for the daily job. If we tagged all tests with something like @ci and @daily (as appropriate) it might be more explicit, but it would also be more noisy. 🤔

Most repositories run all tests in both the CI and the daily job, if a repository has one. Tagging tests with @daily is an exception. Code search says (q=%40daily&files=package.json) that only 4 out of more than 30 repositories uses the @daily tag.

Change 809608 had a related patch set uploaded (by Esther Akinloose; author: Esther Akinloose):

[mediawiki/extensions/VisualEditor@master] WIP selenium: Enable tests

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

Change 809608 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] selenium: Enable all tests

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

Just got another one of these during gate and submit from an VE patch:

13:00:25 [Chrome 90.0.4430.212 linux #0-0] Content Editable
13:00:25 [Chrome 90.0.4430.212 linux #0-0]    ✓ should load when an url is opened @daily
13:00:25 [Chrome 90.0.4430.212 linux #0-0]    ✓ should be editable
13:00:25 [Chrome 90.0.4430.212 linux #0-0]    ✖ should save an edit
13:00:25 [Chrome 90.0.4430.212 linux #0-0]
13:00:25 [Chrome 90.0.4430.212 linux #0-0] 2 passing (18.4s)
13:00:25 [Chrome 90.0.4430.212 linux #0-0] 1 failing
13:00:25 [Chrome 90.0.4430.212 linux #0-0]
13:00:25 [Chrome 90.0.4430.212 linux #0-0] 1) Content Editable should save an edit
13:00:25 [Chrome 90.0.4430.212 linux #0-0] Can't call getText on element with selector "div.mw-notification-content span.oo-ui-labelElement-label" because element wasn't found
13:00:25 [Chrome 90.0.4430.212 linux #0-0] Error: Can't call getText on element with selector "div.mw-notification-content span.oo-ui-labelElement-label" because element wasn't found
13:00:25 [Chrome 90.0.4430.212 linux #0-0]     at implicitWait (/workspace/src/extensions/VisualEditor/node_modules/webdriverio/build/utils/implicitWait.js:34:19)
13:00:25 [Chrome 90.0.4430.212 linux #0-0]     at async Element.elementErrorHandlerCallbackFn (/workspace/src/extensions/VisualEditor/node_modules/webdriverio/build/middlewares.js:20:29)
13:00:25 [Chrome 90.0.4430.212 linux #0-0]     at async Element.wrapCommandFn (/workspace/src/extensions/VisualEditor/node_modules/@wdio/utils/build/shim.js:131:29)
13:00:25 [Chrome 90.0.4430.212 linux #0-0]     at async Context.<anonymous> (/workspace/src/extensions/VisualEditor/tests/selenium/specs/content_editable.js:57:23)

https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-selenium-docker/128128/console

Change 811720 had a related patch set uploaded (by Esther Akinloose; author: Esther Akinloose):

[mediawiki/extensions/VisualEditor@master] selenium: Fix assertion in 'Content Editable should save an edit'

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

Change 811723 had a related patch set uploaded (by Esther Akinloose; author: Esther Akinloose):

[mediawiki/extensions/VisualEditor@master] selenium: Disable flaky test

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

@WMDE-Fisch That looks like it could be a different problem, the error doesn't mention "Execution context was destroyed". I'll file a separate task.

Looks like this problem is resolved, so resolving this task. Another problem is T312307.

Change 807126 abandoned by Zfilipin:

[mediawiki/extensions/VisualEditor@master] WIP selenium: Run tests 100 times

Reason:

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

Change 811723 abandoned by Zfilipin:

[mediawiki/extensions/VisualEditor@master] selenium: Disable flaky test

Reason:

T310772 is resolved

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

Change 811720 abandoned by Zfilipin:

[mediawiki/extensions/VisualEditor@master] selenium: Fix assertion in 'Content Editable should save an edit'

Reason:

T310772 is resolved

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

Change 807126 restored by Zfilipin:

[mediawiki/extensions/VisualEditor@master] WIP selenium: Run tests 100 times

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