Skip to content

Commit

Permalink
test: ensure nextTick is not scheduled in exit
Browse files Browse the repository at this point in the history
Previously our tests did not check this codepath as seen at
coverage.nodejs.org

PR-URL: #9555
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
Fishrock123 authored and addaleax committed Nov 22, 2016
1 parent 00a5490 commit ccc6e75
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/parallel/test-next-tick-when-exiting.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

const common = require('../common');
const assert = require('assert');

process.on('exit', () => {
assert.strictEqual(process._exiting, true, 'process._exiting was not set!');

process.nextTick(() => {
common.fail('process is exiting, should not be called.');
});
});

process.exit();

0 comments on commit ccc6e75

Please sign in to comment.