From 90443f7a8a26dd9a945094d0ad2c3358b70cc812 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 12 Aug 2021 07:47:57 +0200 Subject: [PATCH] tests - try to make some tests more robust --- src/vs/base/test/common/async.test.ts | 20 ++++++++++++----- .../src/areas/statusbar/statusbar.test.ts | 22 +++++++++---------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/vs/base/test/common/async.test.ts b/src/vs/base/test/common/async.test.ts index d2afd559250..32ff92beaaa 100644 --- a/src/vs/base/test/common/async.test.ts +++ b/src/vs/base/test/common/async.test.ts @@ -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); diff --git a/test/smoke/src/areas/statusbar/statusbar.test.ts b/test/smoke/src/areas/statusbar/statusbar.test.ts index 81d6f335e10..954cefedcc3 100644 --- a/test/smoke/src/areas/statusbar/statusbar.test.ts +++ b/test/smoke/src/areas/statusbar/statusbar.test.ts @@ -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'); + }); }); }