smoke - restore workaround for #146785

This commit is contained in:
Benjamin Pasero 2022-04-13 17:21:40 +02:00
parent 44b6695d4e
commit 98d2ea4444
No known key found for this signature in database
GPG Key ID: E6380CC4C8219E65

View File

@ -121,7 +121,7 @@ export class Application {
await code.waitForWindowIds(ids => ids.length > 0);
// We need a rendered workbench
await measureAndLog(code.waitForElement('.monaco-workbench'), 'Application#checkWindowReady: wait for .monaco-workbench element', this.logger);
await this.checkWorkbenchReady(code);
// Remote but not web: wait for a remote connection state change
if (this.remote) {
@ -140,4 +140,28 @@ export class Application {
}, 300 /* = 30s of retry */), 'Application#checkWindowReady: wait for remote indicator', this.logger);
}
}
private async checkWorkbenchReady(code: Code): Promise<void> {
const driver = code.driver;
// Web / Legacy: just poll for workbench element
if (this.web) {
await measureAndLog(code.waitForElement('.monaco-workbench'), 'Application#checkWindowReady: wait for .monaco-workbench element', this.logger);
}
// Desktop (playwright): we see hangs, where IPC messages
// are not delivered (https://github.com/microsoft/vscode/issues/146785)
// Workaround is to try to reload the window when that happens
else {
try {
await measureAndLog(code.waitForElement('.monaco-workbench', undefined, 100 /* 10s of retry */), 'Application#checkWindowReady: wait for .monaco-workbench element', this.logger);
} catch (error) {
this.logger.log(`checkWindowReady: giving up after 10s, reloading window and trying again...`);
await driver.reload();
return this.checkWorkbenchReady(code);
}
}
}
}