summaryrefslogtreecommitdiff
path: root/test/async-hooks
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-02-07 01:36:20 +0100
committerAnna Henningsen <anna@addaleax.net>2018-02-21 20:42:18 +0100
commit03ddd13d8a72190aa22194eb535e9cb683f4f815 (patch)
treea69fd4503770103c027fc4662752eb5964c98ee2 /test/async-hooks
parent6bdc18c592b9d66fd652a9bdaa53f87486d0a634 (diff)
downloadandroid-node-v8-03ddd13d8a72190aa22194eb535e9cb683f4f815.tar.gz
android-node-v8-03ddd13d8a72190aa22194eb535e9cb683f4f815.tar.bz2
android-node-v8-03ddd13d8a72190aa22194eb535e9cb683f4f815.zip
net: use `_final` instead of `on('finish')`
Shutting down the connection is what `_final` is there for. PR-URL: https://github.com/nodejs/node/pull/18608 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'test/async-hooks')
-rw-r--r--test/async-hooks/test-shutdownwrap.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/async-hooks/test-shutdownwrap.js b/test/async-hooks/test-shutdownwrap.js
index dfaac2a1c0..fea4a3a166 100644
--- a/test/async-hooks/test-shutdownwrap.js
+++ b/test/async-hooks/test-shutdownwrap.js
@@ -24,11 +24,13 @@ let endedConnection = false;
function onconnection(c) {
assert.strictEqual(hooks.activitiesOfTypes('SHUTDOWNWRAP').length, 0);
c.end();
- endedConnection = true;
- const as = hooks.activitiesOfTypes('SHUTDOWNWRAP');
- assert.strictEqual(as.length, 1);
- checkInvocations(as[0], { init: 1 }, 'after ending client connection');
- this.close(onserverClosed);
+ process.nextTick(() => {
+ endedConnection = true;
+ const as = hooks.activitiesOfTypes('SHUTDOWNWRAP');
+ assert.strictEqual(as.length, 1);
+ checkInvocations(as[0], { init: 1 }, 'after ending client connection');
+ this.close(onserverClosed);
+ });
}
function onconnected() {