Skip to content

Commit a8ea166

Browse files
fix flaky test
Signed-off-by: nkomonen-amazon <[email protected]>
1 parent 585b17b commit a8ea166

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/core/src/shared/crashMonitoring.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,9 @@ export class FileSystemState {
466466
public async indicateGracefulShutdown(): Promise<void> {
467467
// By removing the heartbeat entry, the crash checkers will not be able to find this entry anymore, making it
468468
// impossible to report on since the file system is the source of truth
469-
await withFailCtx('indicateGracefulShutdown', () => nodeFs.rm(this.makeStateFilePath(this.extId)))
469+
await withFailCtx('indicateGracefulShutdown', () =>
470+
nodeFs.rm(this.makeStateFilePath(this.extId), { force: true })
471+
)
470472
}
471473

472474
// ------------------ Checker Methods ------------------

packages/core/src/test/shared/crashMonitoring.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const crashMonitoringTest = async () => {
3030

3131
// Add some buffer since after 1 interval the work is actually done, including file i/o which may be slow.
3232
// **IF FLAKY**, see if increasing the buffer helps.
33-
const oneInterval = checkInterval + 500
33+
const oneInterval = checkInterval + 1000
3434

3535
/**
3636
* Makes N "extension instances" that can be used for testing.
@@ -122,6 +122,7 @@ export const crashMonitoringTest = async () => {
122122
await exts[i].ext.start()
123123
}
124124

125+
// Crash all exts except the 0th one
125126
for (let i = 1; i < extCount; i++) {
126127
await exts[i].ext.crash()
127128
latestCrashedExts.push(exts[i])

0 commit comments

Comments
 (0)