From 0972fa3c16b3f8e41e5a549a2d44b2700c1e6d08 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 22 Nov 2019 15:19:33 +0100 Subject: [PATCH] test: add regression test for signal handler removal in exit Refs: https://github.com/nodejs/node/pull/30581 Refs: https://github.com/nodejs/node/pull/30582 PR-URL: https://github.com/nodejs/node/pull/30589 Refs: https://github.com/nodejs/node/issues/30581 Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Richard Lau Reviewed-By: Beth Griggs Reviewed-By: Michael Dawson Reviewed-By: Luigi Pinca --- test/parallel/test-signal-handler-remove-on-exit.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test/parallel/test-signal-handler-remove-on-exit.js diff --git a/test/parallel/test-signal-handler-remove-on-exit.js b/test/parallel/test-signal-handler-remove-on-exit.js new file mode 100644 index 00000000000000..1c87497172e66a --- /dev/null +++ b/test/parallel/test-signal-handler-remove-on-exit.js @@ -0,0 +1,9 @@ +'use strict'; +require('../common'); + +// Regression test for https://github.com/nodejs/node/issues/30581 +// This script should not crash. + +function dummy() {} +process.on('SIGINT', dummy); +process.on('exit', () => process.removeListener('SIGINT', dummy));