The Wayback Machine - https://web.archive.org/web/20250407172613/https://github.com/nodejs/node/commit/37a362275e
Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Commit 37a3622

Browse filesBrowse files
cjihrigMylesBorins
authored andcommitted
test: update test-cluster-shared-handle-bind-error
- Remove assignment of this to variable. - Add common.mustCall() as needed. - Move from var to const. PR-URL: #10547 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent f5e54f5 commit 37a3622
Copy full SHA for 37a3622

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

‎test/parallel/test-cluster-shared-handle-bind-error.js

Copy file name to clipboardexpand all lines: test/parallel/test-cluster-shared-handle-bind-error.js
+12-11
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
4-
var cluster = require('cluster');
5-
var net = require('net');
2+
const common = require('../common');
3+
const assert = require('assert');
4+
const cluster = require('cluster');
5+
const net = require('net');
66

77
if (cluster.isMaster) {
88
// Master opens and binds the socket and shares it with the worker.
99
cluster.schedulingPolicy = cluster.SCHED_NONE;
1010
// Hog the TCP port so that when the worker tries to bind, it'll fail.
11-
net.createServer(common.fail).listen(common.PORT, function() {
12-
var server = this;
13-
var worker = cluster.fork();
14-
worker.on('exit', common.mustCall(function(exitCode) {
11+
const server = net.createServer(common.fail);
12+
13+
server.listen(common.PORT, common.mustCall(() => {
14+
const worker = cluster.fork();
15+
worker.on('exit', common.mustCall((exitCode) => {
1516
assert.strictEqual(exitCode, 0);
1617
server.close();
1718
}));
18-
});
19+
}));
1920
} else {
20-
var s = net.createServer(common.fail);
21+
const s = net.createServer(common.fail);
2122
s.listen(common.PORT, common.fail.bind(null, 'listen should have failed'));
22-
s.on('error', common.mustCall(function(err) {
23+
s.on('error', common.mustCall((err) => {
2324
assert.strictEqual(err.code, 'EADDRINUSE');
2425
process.disconnect();
2526
}));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.