Skip to content

Commit 8708c52

Browse files
authored
test(codecatalyst): only fail test if message is >1 minute off #6265
## Problem fix #6213 ## Solution - The important part of this test is that the message comes after being inactive. If the message comes slightly early/late, that is okay. If it doesn't come at all, then we have problems and should fail. - Pass test if message comes within a minute of expected.
1 parent cfa53f1 commit 8708c52

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/core/src/testInteg/codecatalyst/devEnv.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,12 @@ describe('InactivityMessage', function () {
141141
message: expectedMessages[i][0],
142142
minute: expectedMessages[i][1],
143143
}
144-
assert.deepStrictEqual(actualMessages[i], expected)
144+
assert.deepStrictEqual(actualMessages[i].message, expected.message)
145+
// Avoid flakiness in the timing by looking within a minute rather than exact.
146+
assert.ok(
147+
Math.abs(actualMessages[i].minute - expected.minute) <= 1,
148+
`Expected to be within 60 seconds of minute ${expected.minute}, but instead was at minute ${actualMessages[i].minute}`
149+
)
145150
}
146151
}
147152

0 commit comments

Comments
 (0)