Skip to content

Commit ab724d5

Browse files
committed
wait for connections to close
1 parent b65f333 commit ab724d5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

integration/test/helper.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const Parse = require('../../node');
1010
const fs = require('fs').promises;
1111
const path = require('path');
1212
const dns = require('dns');
13+
const sleep = require('./sleep');
1314
const MockEmailAdapterWithOptions = require('./support/MockEmailAdapterWithOptions');
1415

1516
// Ensure localhost resolves to ipv4 address first on node v17+
@@ -99,6 +100,8 @@ const reconfigureServer = async (changedConfiguration = {}) => {
99100
if (parseServer) {
100101
try {
101102
await parseServer.handleShutdown();
103+
// Connection close events are not immediate on node 10+, so wait a bit
104+
sleep(0);
102105
} catch (e) {
103106
console.error('Failed to shutdown the server', e);
104107
}

0 commit comments

Comments
 (0)