Skip to content

Commit a091b99

Browse files
lpincadanielleadams
authored andcommittedDec 30, 2022
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: #42340 Refs: #42340 (comment) Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent f8f2ae8 commit a091b99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎test/async-hooks/test-tcpwrap.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ function onconnection(c) {
128128
}
129129

130130
function onserverClosed() {
131-
checkInvocations(tcpserver, { init: 1, before: 1, after: 1, destroy: 1 },
132-
'tcpserver when server is closed');
133131
setImmediate(() => {
132+
checkInvocations(tcpserver, { init: 1, before: 1, after: 1, destroy: 1 },
133+
'tcpserver when server is closed');
134134
checkInvocations(tcp1, { init: 1, before: 2, after: 2, destroy: 1 },
135135
'tcp1 after server is closed');
136136
});

0 commit comments

Comments
 (0)