You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't detect async handles already queued to close
Some types of async resources in Node.js are not destroyed until *after* their `close` or `end` or similar callbacks and events run, leading to a situation where the `--detectOpenHandles` option can falsely flag resources that have been cleaned up in user code and are already scheduled for destruction. For example, if a test ends from the callback to `TCPServer.close()` and no other tests or lifecycle functions impose additional delays, `--detectOpenHandles` will flag the server even though it has been closed. This is the main cause of issues people encounter with Supertest (see jestjs#8554).
This addresses the issue by adding a short delay before collecting open handles.
Depends on jestjs#11382.
Copy file name to clipboardExpand all lines: e2e/__tests__/__snapshots__/detectOpenHandles.ts.snap
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
// Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
3
+
exports[`does not print info about open handlers for a server that is already closed 1`] =``;
4
+
3
5
exports[`prints message about flag on forceExit 1`] =`Force exiting Jest: Have you considered using \`--detectOpenHandles\` to detect async operations that kept running after all tests finished?`;
4
6
5
7
exports[`prints message about flag on slow tests 1`] =`
0 commit comments