From 6be77a312decd8eb115d2ade3607038b1e375af4 Mon Sep 17 00:00:00 2001 From: Dmytro Nochevnov Date: Mon, 21 Oct 2019 18:49:39 +0300 Subject: [PATCH 1/5] Log workaround failed Java LS server initialization Signed-off-by: Dmytro Nochevnov --- e2e/pageobjects/ide/Ide.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/e2e/pageobjects/ide/Ide.ts b/e2e/pageobjects/ide/Ide.ts index 0acedc93e90..ee9ac121276 100644 --- a/e2e/pageobjects/ide/Ide.ts +++ b/e2e/pageobjects/ide/Ide.ts @@ -221,6 +221,13 @@ export class Ide { throw err; } + const workaroundReportText: string = '\n############################## \n\n' + + 'Known issue: https://github.com/eclipse/che/issues/14944 \n' + + '"Java LS server initialization failed" \n' + + '############################## \n'; + + console.log(workaroundReportText); + await this.driverHelper.getDriver().navigate().refresh(); await this.waitAndSwitchToIdeFrame(); await this.waitStatusBarContains(expectedTextInStatusBar); From c11b18beea6267362962b3567df6909cec144b3d Mon Sep 17 00:00:00 2001 From: Dmytro Nochevnov Date: Tue, 22 Oct 2019 01:26:55 +0300 Subject: [PATCH 2/5] Don't hide flakiness Signed-off-by: Dmytro Nochevnov --- e2e/pageobjects/ide/Ide.ts | 22 ++-------------------- e2e/tests/e2e_happy_path/HappyPath.spec.ts | 9 ++++++++- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/e2e/pageobjects/ide/Ide.ts b/e2e/pageobjects/ide/Ide.ts index ee9ac121276..c906c861650 100644 --- a/e2e/pageobjects/ide/Ide.ts +++ b/e2e/pageobjects/ide/Ide.ts @@ -213,26 +213,8 @@ export class Ide { async checkLsInitializationStart(expectedTextInStatusBar: string) { Logger.debug('Ide.checkLsInitializationStart'); - - try { - await this.waitStatusBarContains(expectedTextInStatusBar, 20000); - } catch (err) { - if (!(err instanceof error.TimeoutError)) { - throw err; - } - - const workaroundReportText: string = '\n############################## \n\n' + - 'Known issue: https://github.com/eclipse/che/issues/14944 \n' + - '"Java LS server initialization failed" \n' + - '############################## \n'; - - console.log(workaroundReportText); - - await this.driverHelper.getDriver().navigate().refresh(); - await this.waitAndSwitchToIdeFrame(); - await this.waitStatusBarContains(expectedTextInStatusBar); - } - + + await this.waitStatusBarContains(expectedTextInStatusBar, 20000); } async closeAllNotifications() { diff --git a/e2e/tests/e2e_happy_path/HappyPath.spec.ts b/e2e/tests/e2e_happy_path/HappyPath.spec.ts index 2c3840231f6..cd5dda48307 100644 --- a/e2e/tests/e2e_happy_path/HappyPath.spec.ts +++ b/e2e/tests/e2e_happy_path/HappyPath.spec.ts @@ -93,7 +93,14 @@ suite('Language server validation', async () => { test('Java LS initialization', async () => { await projectTree.expandPathAndOpenFileInAssociatedWorkspace(pathToJavaFolder, javaFileName); await editor.selectTab(javaFileName); - await ide.checkLsInitializationStart('Starting Java Language Server'); + + try { + await ide.checkLsInitializationStart('Starting Java Language Server'); + } catch (err) { + console.log("Known flakiness https://github.com/eclipse/che/issues/14944"); + throw err; + } + await ide.waitStatusBarTextAbsence('Starting Java Language Server', 1800000); await checkJavaPathCompletion(); await ide.waitStatusBarTextAbsence('Building workspace', 360000); From 789f8621bed66582e5353fe4565e0ae71b9a175f Mon Sep 17 00:00:00 2001 From: Dmytro Nochevnov Date: Tue, 22 Oct 2019 14:21:30 +0300 Subject: [PATCH 3/5] Fix workaround Signed-off-by: Dmytro Nochevnov --- e2e/tests/e2e_happy_path/HappyPath.spec.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/e2e/tests/e2e_happy_path/HappyPath.spec.ts b/e2e/tests/e2e_happy_path/HappyPath.spec.ts index cd5dda48307..4216460c1ca 100644 --- a/e2e/tests/e2e_happy_path/HappyPath.spec.ts +++ b/e2e/tests/e2e_happy_path/HappyPath.spec.ts @@ -97,8 +97,13 @@ suite('Language server validation', async () => { try { await ide.checkLsInitializationStart('Starting Java Language Server'); } catch (err) { - console.log("Known flakiness https://github.com/eclipse/che/issues/14944"); - throw err; + if (!(err instanceof error.TimeoutError)) { + throw err; + } + + console.log("Known flakiness has occurred https://github.com/eclipse/che/issues/14944"); + await driverHelper.reloadPage(); + await ide.waitStatusBarContains(expectedTextInStatusBar); } await ide.waitStatusBarTextAbsence('Starting Java Language Server', 1800000); From a27c360bd0470fb4f15865c199146021ef7b1db1 Mon Sep 17 00:00:00 2001 From: Dmytro Nochevnov Date: Tue, 22 Oct 2019 14:31:15 +0300 Subject: [PATCH 4/5] Fix error Signed-off-by: Dmytro Nochevnov --- e2e/tests/e2e_happy_path/HappyPath.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/tests/e2e_happy_path/HappyPath.spec.ts b/e2e/tests/e2e_happy_path/HappyPath.spec.ts index 4216460c1ca..fbb4ff48885 100644 --- a/e2e/tests/e2e_happy_path/HappyPath.spec.ts +++ b/e2e/tests/e2e_happy_path/HappyPath.spec.ts @@ -103,7 +103,7 @@ suite('Language server validation', async () => { console.log("Known flakiness has occurred https://github.com/eclipse/che/issues/14944"); await driverHelper.reloadPage(); - await ide.waitStatusBarContains(expectedTextInStatusBar); + await ide.waitStatusBarContains('Starting Java Language Server'); } await ide.waitStatusBarTextAbsence('Starting Java Language Server', 1800000); From 32ce70baadfe83459138685c8b71556541ec9e7f Mon Sep 17 00:00:00 2001 From: Dmytro Nochevnov Date: Tue, 22 Oct 2019 16:57:40 +0300 Subject: [PATCH 5/5] Set Log.debug() for DriverHelper methods with high impact Signed-off-by: Dmytro Nochevnov --- e2e/utils/DriverHelper.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/utils/DriverHelper.ts b/e2e/utils/DriverHelper.ts index 2725d9f35f4..7afda9e3371 100644 --- a/e2e/utils/DriverHelper.ts +++ b/e2e/utils/DriverHelper.ts @@ -460,7 +460,7 @@ export class DriverHelper { } public async reloadPage() { - Logger.trace('DriverHelper.reloadPage'); + Logger.debug('DriverHelper.reloadPage'); await this.driver.navigate().refresh(); } @@ -473,7 +473,7 @@ export class DriverHelper { } public async navigateToUrl(url: string) { - Logger.trace(`DriverHelper.navigateToUrl ${url}`); + Logger.debug(`DriverHelper.navigateToUrl ${url}`); await this.driver.navigate().to(url); } @@ -534,7 +534,7 @@ export class DriverHelper { } async switchToSecondWindow(mainWindowHandle: string) { - Logger.trace('DriverHelper.switchToSecondWindow'); + Logger.debug('DriverHelper.switchToSecondWindow'); await this.waitOpenningSecondWindow(); const handles: string[] = await this.driver.getAllWindowHandles();