Skip to content

Commit

Permalink
test(codecatalyst): only fail test if message is >1 minute off #6265
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
Hweinstock authored Dec 18, 2024
1 parent cfa53f1 commit 8708c52
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/core/src/testInteg/codecatalyst/devEnv.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,12 @@ describe('InactivityMessage', function () {
message: expectedMessages[i][0],
minute: expectedMessages[i][1],
}
assert.deepStrictEqual(actualMessages[i], expected)
assert.deepStrictEqual(actualMessages[i].message, expected.message)
// Avoid flakiness in the timing by looking within a minute rather than exact.
assert.ok(
Math.abs(actualMessages[i].minute - expected.minute) <= 1,
`Expected to be within 60 seconds of minute ${expected.minute}, but instead was at minute ${actualMessages[i].minute}`
)
}
}

Expand Down

0 comments on commit 8708c52

Please sign in to comment.