diff --git a/test/parallel/test-http-pipeline-flood.js b/test/parallel/test-http-pipeline-flood.js index 29df81e857db60..0c5bd1dcd20de2 100644 --- a/test/parallel/test-http-pipeline-flood.js +++ b/test/parallel/test-http-pipeline-flood.js @@ -53,6 +53,15 @@ function parent() { const args = [__filename, 'child', this.address().port]; const child = spawn(process.execPath, args, { stdio: 'inherit' }); child.on('close', common.mustCall(function() { + if (common.isIBMi) { + // On IBM i calling server.close after the child process closes + // is not enough to end the server. For some reason the connection still + // lingers around with the server even though the process was closed. + // Calling closeAllConnections cleans up the lingering connection. + // Then calling server.close stops the server from listening + // for new connections and ends the server. + server.closeAllConnections(); + } server.close(); }));