File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ const nextDev: CliCommand = async (argv) => {
219
219
220
220
const { validateTurboNextConfig } =
221
221
require ( '../lib/turbopack-warning' ) as typeof import ( '../lib/turbopack-warning' )
222
- const { loadBindings, __isCustomTurbopackBinary } =
222
+ const { loadBindings, __isCustomTurbopackBinary, teardownHeapProfiler } =
223
223
require ( '../build/swc' ) as typeof import ( '../build/swc' )
224
224
const { eventCliSession } =
225
225
require ( '../telemetry/events/version' ) as typeof import ( '../telemetry/events/version' )
@@ -286,6 +286,13 @@ const nextDev: CliCommand = async (argv) => {
286
286
if ( ! isCustomTurbopack ) {
287
287
await telemetry . flush ( )
288
288
}
289
+
290
+ // There are some cases like test fixtures teardown that normal flush won't hit.
291
+ // Force flush those on those case, but don't wait for it.
292
+ ; [ 'SIGTERM' , 'SIGINT' , 'beforeExit' , 'exit' ] . forEach ( ( event ) =>
293
+ process . on ( event , ( ) => teardownHeapProfiler ( ) )
294
+ )
295
+
289
296
return server
290
297
} else {
291
298
let cleanupFns : ( ( ) => Promise < void > | void ) [ ] = [ ]
You can’t perform that action at this time.
0 commit comments