Skip to content

Commit 949971c

Browse files
committed
Add test setup to increase abortSignal max listeners
Prevent MaxListenersExceededWarning during high-concurrency batch tests by increasing the listener limit from 10 to 50.
1 parent f292ecd commit 949971c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/utils/setup.mts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/** @fileoverview Vitest setup file for test utilities. */
2+
import events from 'node:events'
3+
4+
import abortSignal from '@socketsecurity/registry/lib/constants/abort-signal'
5+
6+
// Increase max listeners for abortSignal to prevent warnings during high-concurrency tests.
7+
// The batchPackageStream method can add many concurrent abort listeners.
8+
events.setMaxListeners(50, abortSignal)

0 commit comments

Comments
 (0)