IntervalCounter flaky web test (fix #129774)

This commit is contained in:
Benjamin Pasero
2021-08-04 11:02:39 +02:00
parent b6ca3e52ae
commit ff69e14f5d
+4 -3
View File
@@ -740,14 +740,15 @@ suite('Async', () => {
});
test('IntervalCounter', async () => {
const counter = new async.IntervalCounter(10);
const counter = new async.IntervalCounter(1);
assert.strictEqual(counter.increment(), 1);
assert.strictEqual(counter.increment(), 2);
assert.strictEqual(counter.increment(), 3);
const now = Date.now();
await async.timeout(20);
if (Date.now() - now < 11) {
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)
}