From 2629f8a15992085a89687194c382a4a618ca086b Mon Sep 17 00:00:00 2001 From: Dmytro Nochevnov Date: Tue, 22 Oct 2019 18:39:59 +0300 Subject: [PATCH] Log and fix workaround to Java LS server initialization failure (#14945) Signed-off-by: Dmytro Nochevnov --- e2e/pageobjects/ide/Ide.ts | 15 ++------------- e2e/tests/e2e_happy_path/HappyPath.spec.ts | 14 +++++++++++++- e2e/utils/DriverHelper.ts | 6 +++--- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/e2e/pageobjects/ide/Ide.ts b/e2e/pageobjects/ide/Ide.ts index 0acedc93e90..c906c861650 100644 --- a/e2e/pageobjects/ide/Ide.ts +++ b/e2e/pageobjects/ide/Ide.ts @@ -213,19 +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; - } - - 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..fbb4ff48885 100644 --- a/e2e/tests/e2e_happy_path/HappyPath.spec.ts +++ b/e2e/tests/e2e_happy_path/HappyPath.spec.ts @@ -93,7 +93,19 @@ 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) { + 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('Starting Java Language Server'); + } + await ide.waitStatusBarTextAbsence('Starting Java Language Server', 1800000); await checkJavaPathCompletion(); await ide.waitStatusBarTextAbsence('Building workspace', 360000); 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();