We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 46c1d99 commit 24d08feCopy full SHA for 24d08fe
test/parallel/test-http-end-throw-socket-handling.js
@@ -21,6 +21,7 @@
21
22
'use strict';
23
const common = require('../common');
24
+const Countdown = require('../common/countdown');
25
26
// Make sure that throwing in 'end' handler doesn't lock
27
// up the socket forever.
@@ -29,10 +30,10 @@ const common = require('../common');
29
30
// the same, we should not be so brittle and easily broken.
31
32
const http = require('http');
33
+const countdown = new Countdown(10, () => server.close());
34
-let n = 0;
35
const server = http.createServer((req, res) => {
- if (++n === 10) server.close();
36
+ countdown.dec();
37
res.end('ok');
38
});
39
0 commit comments