diff --git a/src/vs/base/test/common/async.test.ts b/src/vs/base/test/common/async.test.ts index dbf420da1f0d1..c33c51aa0ff91 100644 --- a/src/vs/base/test/common/async.test.ts +++ b/src/vs/base/test/common/async.test.ts @@ -1520,42 +1520,43 @@ suite('Async', () => { assert.strictEqual(worked, false); }); - test('waitThrottleDelayBetweenWorkUnits option', async () => { - const handled: number[] = []; - let handledCallback: Function; - let handledPromise = new Promise(resolve => handledCallback = resolve); - let currentTime = 0; - - const handler = (units: readonly number[]) => { - handled.push(...units); - handledCallback(); - handledPromise = new Promise(resolve => handledCallback = resolve); - }; - - const worker = store.add(new async.ThrottledWorker({ - maxWorkChunkSize: 5, - maxBufferedWork: undefined, - throttleDelay: 5, - waitThrottleDelayBetweenWorkUnits: true - }, handler)); - - // Schedule work, it should execute immediately - currentTime = Date.now(); - let worked = worker.work([1, 2, 3]); - assert.strictEqual(worked, true); - assertArrayEquals(handled, [1, 2, 3]); - assert.strictEqual(Date.now() - currentTime < 5, true); - - // Schedule work again, it should wait at least throttle delay before executing - currentTime = Date.now(); - worked = worker.work([4, 5]); - assert.strictEqual(worked, true); - // Throttle delay hasn't reset so we still must wait - assertArrayEquals(handled, [1, 2, 3]); - await handledPromise; - assert.strictEqual(Date.now() - currentTime >= 5, true); - assertArrayEquals(handled, [1, 2, 3, 4, 5]); - }); + // https://github.com/microsoft/vscode/issues/230366 + // test('waitThrottleDelayBetweenWorkUnits option', async () => { + // const handled: number[] = []; + // let handledCallback: Function; + // let handledPromise = new Promise(resolve => handledCallback = resolve); + // let currentTime = 0; + + // const handler = (units: readonly number[]) => { + // handled.push(...units); + // handledCallback(); + // handledPromise = new Promise(resolve => handledCallback = resolve); + // }; + + // const worker = store.add(new async.ThrottledWorker({ + // maxWorkChunkSize: 5, + // maxBufferedWork: undefined, + // throttleDelay: 5, + // waitThrottleDelayBetweenWorkUnits: true + // }, handler)); + + // // Schedule work, it should execute immediately + // currentTime = Date.now(); + // let worked = worker.work([1, 2, 3]); + // assert.strictEqual(worked, true); + // assertArrayEquals(handled, [1, 2, 3]); + // assert.strictEqual(Date.now() - currentTime < 5, true); + + // // Schedule work again, it should wait at least throttle delay before executing + // currentTime = Date.now(); + // worked = worker.work([4, 5]); + // assert.strictEqual(worked, true); + // // Throttle delay hasn't reset so we still must wait + // assertArrayEquals(handled, [1, 2, 3]); + // await handledPromise; + // assert.strictEqual(Date.now() - currentTime >= 5, true); + // assertArrayEquals(handled, [1, 2, 3, 4, 5]); + // }); }); suite('LimitedQueue', () => {