smoke tests - try to fix data migration test (#129279)

This commit is contained in:
Benjamin Pasero 2021-08-05 07:56:51 +02:00
parent cbdb18da38
commit 70e6d3f85d
No known key found for this signature in database
GPG key ID: E6380CC4C8219E65
2 changed files with 13 additions and 6 deletions

View file

@ -6,6 +6,7 @@
import { Application, ApplicationOptions, Quality } from '../../../../automation';
import { join } from 'path';
import { ParsedArgs } from 'minimist';
import { timeout } from '../../utils';
export function setup(opts: ParsedArgs, testDataPath: string) {
@ -64,12 +65,6 @@ export function setup(opts: ParsedArgs, testDataPath: string) {
this.skip();
}
// Windows: this test is flaky for yet unknown reasons
// https://github.com/microsoft/vscode/issues/129279
if (process.platform === 'win32') {
this.retries(2);
}
const userDataDir = join(testDataPath, 'd3'); // different data dir from the other tests
const stableOptions: ApplicationOptions = Object.assign({}, this.defaultOptions);
@ -91,6 +86,8 @@ export function setup(opts: ParsedArgs, testDataPath: string) {
await stableApp.workbench.quickaccess.openFile(readmeMd);
await stableApp.workbench.editor.waitForTypeInEditor(readmeMd, textToType);
await timeout(2000); // give time to store the backup before stopping the app
await stableApp.stop();
const insiderOptions: ApplicationOptions = Object.assign({}, this.defaultOptions);
@ -99,9 +96,11 @@ export function setup(opts: ParsedArgs, testDataPath: string) {
const insidersApp = new Application(insiderOptions);
await insidersApp.start();
await insidersApp.workbench.editors.waitForTab(readmeMd, true);
await insidersApp.workbench.editors.selectTab(readmeMd);
await insidersApp.workbench.editor.waitForEditorContents(readmeMd, c => c.indexOf(textToType) > -1);
await insidersApp.workbench.editors.waitForTab(untitled, true);
await insidersApp.workbench.editors.selectTab(untitled);
await insidersApp.workbench.editor.waitForEditorContents(untitled, c => c.indexOf(textToTypeInUntitled) > -1);

View file

@ -56,3 +56,11 @@ export function afterSuite(opts: minimist.ParsedArgs) {
}
});
}
export function timeout(i: number) {
return new Promise<void>(resolve => {
setTimeout(() => {
resolve();
}, i);
});
}