Commit fcb31300 by Hugo Häggmark Committed by GitHub

e2e: Adds error catching to prevent flakiness (#27211)

* e2e: Adds error catching to prevent flakiness

* e2e: fixes if statment and cleans up wait
parent ad2e74d1
...@@ -9,6 +9,30 @@ e2e.scenario({ ...@@ -9,6 +9,30 @@ e2e.scenario({
addScenarioDashBoard: false, addScenarioDashBoard: false,
skipScenario: false, skipScenario: false,
scenario: () => { scenario: () => {
// @ts-ignore some typing issue
e2e().on('uncaught:exception', err => {
if (err.stack?.indexOf("TypeError: Cannot read property 'getText' of null") !== -1) {
// On occasion monaco editor will not have the time to be properly unloaded when we change the tab
// and then the e2e test fails with the uncaught:exception:
// TypeError: Cannot read property 'getText' of null
// at Object.ai [as getFoldingRanges] (http://localhost:3001/public/build/monaco-json.worker.js:2:215257)
// at e.getFoldingRanges (http://localhost:3001/public/build/monaco-json.worker.js:2:221188)
// at e.fmr (http://localhost:3001/public/build/monaco-json.worker.js:2:116605)
// at e._handleMessage (http://localhost:3001/public/build/monaco-json.worker.js:2:7414)
// at Object.handleMessage (http://localhost:3001/public/build/monaco-json.worker.js:2:7018)
// at e._handleMessage (http://localhost:3001/public/build/monaco-json.worker.js:2:5038)
// at e.handleMessage (http://localhost:3001/public/build/monaco-json.worker.js:2:4606)
// at e.onmessage (http://localhost:3001/public/build/monaco-json.worker.js:2:7097)
// at Tt.self.onmessage (http://localhost:3001/public/build/monaco-json.worker.js:2:117109)
// return false to prevent the error from
// failing this test
return false;
}
return true;
});
const viewPortWidth = e2e.config().viewportWidth; const viewPortWidth = e2e.config().viewportWidth;
e2e.flows.openDashboard({ uid: '5SdHCadmz' }); e2e.flows.openDashboard({ uid: '5SdHCadmz' });
...@@ -74,20 +98,6 @@ const expectDrawerTabsAndContent = () => { ...@@ -74,20 +98,6 @@ const expectDrawerTabsAndContent = () => {
e2e.components.PanelInspector.Stats.content().should('not.be.visible'); e2e.components.PanelInspector.Stats.content().should('not.be.visible');
e2e.components.PanelInspector.Query.content().should('not.be.visible'); e2e.components.PanelInspector.Query.content().should('not.be.visible');
e2e().wait(350);
/* Monaco Editor specific wait that fixes error below https://github.com/microsoft/monaco-editor/issues/354
TypeError: Cannot read property 'getText' of null
at Object.getFoldingRanges (http://localhost:3001/public/build/json.worker.js:18829:102)
at JSONWorker.getFoldingRanges (http://localhost:3001/public/build/json.worker.js:23818:40)
at EditorSimpleWorker.fmr (http://localhost:3001/public/build/json.worker.js:10407:58)
at SimpleWorkerServer._handleMessage (http://localhost:3001/public/build/json.worker.js:6939:59)
at Object.handleMessage (http://localhost:3001/public/build/json.worker.js:6920:22)
at SimpleWorkerProtocol._handleMessage (http://localhost:3001/public/build/json.worker.js:6757:32)
at SimpleWorkerProtocol.handleMessage (http://localhost:3001/public/build/json.worker.js:6719:10)
at SimpleWorkerServer.onmessage (http://localhost:3001/public/build/json.worker.js:6926:20)
at self.onmessage (http://localhost:3001/public/build/json.worker.js:12050:18)
*/
e2e.components.Tab.title('Query') e2e.components.Tab.title('Query')
.should('be.visible') .should('be.visible')
.click(); .click();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment