tests - try to make some tests more robust

This commit is contained in:
Benjamin Pasero 2021-08-12 07:47:57 +02:00
parent 8eedba6aed
commit 90443f7a8a
No known key found for this signature in database
GPG key ID: E6380CC4C8219E65
2 changed files with 25 additions and 17 deletions

View file

@ -740,16 +740,24 @@ suite('Async', () => {
});
test('IntervalCounter', async () => {
const counter = new async.IntervalCounter(1);
let now = Date.now();
const counter = new async.IntervalCounter(5);
let ellapsed = Date.now() - now;
if (ellapsed > 4) {
return; // flaky (https://github.com/microsoft/vscode/issues/114028)
}
assert.strictEqual(counter.increment(), 1);
assert.strictEqual(counter.increment(), 2);
assert.strictEqual(counter.increment(), 3);
const now = Date.now();
await async.timeout(5);
const ellapsed = Date.now() - now;
if (ellapsed < 1) {
return; // Firefox in Playwright seems to have a flaky timeout implementation (https://github.com/microsoft/vscode/issues/114028)
now = Date.now();
await async.timeout(10);
ellapsed = Date.now() - now;
if (ellapsed < 5) {
return; // flaky (https://github.com/microsoft/vscode/issues/114028)
}
assert.strictEqual(counter.increment(), 1);

View file

@ -65,17 +65,6 @@ export function setup(opts: minimist.ParsedArgs) {
await app.workbench.problems.waitForProblemsView();
});
it(`verifies that 'Tweet us feedback' pop-up appears when clicking on 'Feedback' icon`, async function () {
const app = this.app as Application;
if (app.quality === Quality.Dev) {
return this.skip();
}
await app.workbench.statusbar.clickOn(StatusBarElement.FEEDBACK_ICON);
await app.code.waitForElement('.feedback-form');
});
it(`checks if 'Go to Line' works if called from the status bar`, async function () {
const app = this.app as Application;
@ -99,5 +88,16 @@ export function setup(opts: minimist.ParsedArgs) {
await app.workbench.statusbar.waitForEOL('CRLF');
});
it(`verifies that 'Tweet us feedback' pop-up appears when clicking on 'Feedback' icon`, async function () {
const app = this.app as Application;
if (app.quality === Quality.Dev) {
return this.skip();
}
await app.workbench.statusbar.clickOn(StatusBarElement.FEEDBACK_ICON);
await app.code.waitForElement('.feedback-form');
});
});
}