mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
test: defer invocation checks
Do not immediately check the `tcpserver` hook invocations when it closes. Do it in the next iteration of the event loop. PR-URL: https://github.com/nodejs/node/pull/42340 Refs: https://github.com/nodejs/node/pull/42340#issuecomment-1290964192 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
parent
8dd635eb41
commit
65ec9f35e9
@ -128,9 +128,9 @@ function onconnection(c) {
|
||||
}
|
||||
|
||||
function onserverClosed() {
|
||||
checkInvocations(tcpserver, { init: 1, before: 1, after: 1, destroy: 1 },
|
||||
'tcpserver when server is closed');
|
||||
setImmediate(() => {
|
||||
checkInvocations(tcpserver, { init: 1, before: 1, after: 1, destroy: 1 },
|
||||
'tcpserver when server is closed');
|
||||
checkInvocations(tcp1, { init: 1, before: 2, after: 2, destroy: 1 },
|
||||
'tcp1 after server is closed');
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user