Skip to content

Commit

Permalink
Log and fix workaround to Java LS server initialization failure (#14945)
Browse files Browse the repository at this point in the history
Signed-off-by: Dmytro Nochevnov <dnochevn@redhat.com>
  • Loading branch information
dmytro-ndp committed Oct 29, 2019
1 parent b804ffa commit 798562a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
15 changes: 2 additions & 13 deletions e2e/pageobjects/ide/Ide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
14 changes: 13 additions & 1 deletion e2e/tests/e2e_happy_path/HappyPath.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions e2e/utils/DriverHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ export class DriverHelper {
}

public async reloadPage() {
Logger.trace('DriverHelper.reloadPage');
Logger.debug('DriverHelper.reloadPage');

await this.driver.navigate().refresh();
}
Expand All @@ -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);
}
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 798562a

Please sign in to comment.