Skip to content

Commit 6ceb5bf

Browse files
fix: unreliable "ExtensionUserActivity" test #3696
test is still flaky, increase the delay to give more flexibility. Signed-off-by: Nikolas Komonen <[email protected]>
1 parent 5d621c8 commit 6ceb5bf

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/test/shared/extensionUtilities.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,16 @@ describe('ExtensionUserActivity', function () {
206206
})
207207

208208
it('triggers twice when multiple user activities are fired in separate intervals', async function () {
209-
const throttleDelay = 200
209+
const throttleDelay = 500
210210

211-
const firstInvervalMillisUntilFire = [51, 52, 53, 54]
211+
const firstInvervalMillisUntilFire = [100, 101, 102, 103]
212212

213213
const secondIntervalStart = firstInvervalMillisUntilFire[0] + throttleDelay + 1
214214
const secondIntervalMillisUntilFire = [
215-
secondIntervalStart + 10,
216-
secondIntervalStart + 11,
217-
secondIntervalStart + 11,
218-
secondIntervalStart + 12,
215+
secondIntervalStart + 200,
216+
secondIntervalStart + 201,
217+
secondIntervalStart + 201,
218+
secondIntervalStart + 202,
219219
]
220220

221221
const instance = new ExtensionUserActivity(throttleDelay, [
@@ -225,7 +225,7 @@ describe('ExtensionUserActivity', function () {
225225
instance.onUserActivity(onEventTriggered)
226226
await sleep(secondIntervalStart + throttleDelay + 1)
227227

228-
assert.strictEqual(count, 2)
228+
assert.strictEqual(count, 2, 'May be flaky in CI, increase timings to improve reliability.')
229229
})
230230

231231
describe('does not fire user activity events in specific scenarios', function () {

0 commit comments

Comments
 (0)