Logo
Explore Help
Sign In
1berry/nodejs
1
0
Fork 0
You've already forked nodejs
Code Issues Packages Projects Releases Wiki Activity
nodejs/test/parallel/test-cluster-disconnect-with-no-workers.js

17 lines
297 B
JavaScript
Raw Normal View History

test: enable linting for tests Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-05-19 13:00:06 +02:00
'use strict';
cluster: disconnect callback should always occur Fixes issue in 0.11 where callback doesn't occur if worker count is currently zero. In 0.10 callback occurs after worker count is zero, and occurs in next tick if worker count is currently zero.
2013-12-12 10:34:16 -08:00
var assert = require('assert');
var cluster = require('cluster');
var disconnected;
process.on('exit', function() {
assert(disconnected);
});
cluster.disconnect(function() {
disconnected = true;
});
test: assert cluster.disconnect is async See joyent/node#8043, test passed on v0.11 already, but this makes the test stronger. Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-07-31 16:49:28 -07:00
// Assert that callback is not sometimes synchronous
assert(!disconnected);
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 731ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API