xref: /third_party/node/test/parallel/test-kill-segfault-freebsd.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_cirequire('../common');
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_ci// This test ensures Node.js doesn't crash on hitting Ctrl+C in order to
51cb0ef41Sopenharmony_ci// terminate the currently running process (especially on FreeBSD).
61cb0ef41Sopenharmony_ci// https://github.com/nodejs/node-v0.x-archive/issues/9326
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ciconst assert = require('assert');
91cb0ef41Sopenharmony_ciconst child_process = require('child_process');
101cb0ef41Sopenharmony_ci
111cb0ef41Sopenharmony_ci// NOTE: Was crashing on FreeBSD
121cb0ef41Sopenharmony_ciconst cp = child_process.spawn(process.execPath, [
131cb0ef41Sopenharmony_ci  '-e',
141cb0ef41Sopenharmony_ci  'process.kill(process.pid, "SIGINT")',
151cb0ef41Sopenharmony_ci]);
161cb0ef41Sopenharmony_ci
171cb0ef41Sopenharmony_cicp.on('exit', function(code) {
181cb0ef41Sopenharmony_ci  assert.notStrictEqual(code, 0);
191cb0ef41Sopenharmony_ci});
20

Indexes created Thu Nov 07 10:32:03 CST 2024