diff --git a/packages/@aws-cdk/toolkit/test/actions/watch.test.ts b/packages/@aws-cdk/toolkit/test/actions/watch.test.ts index e179abb934082..c060b126f4ce3 100644 --- a/packages/@aws-cdk/toolkit/test/actions/watch.test.ts +++ b/packages/@aws-cdk/toolkit/test/actions/watch.test.ts @@ -144,6 +144,9 @@ describe('watch', () => { expect(deploySpy).toHaveBeenCalledWith(expect.anything(), 'watch', expect.objectContaining({ cloudWatchLogMonitor: expect.anything(), // Not undefined })); + + // Deactivate the cloudWatchLogMonitor that we created, otherwise the tests won't exit + (deploySpy.mock.calls[0]?.[2] as any).cloudWatchLogMonitor?.deactivate(); }); describe.each([