Rework disconnect logic for connectors

Rework the way disconnection at shutdown is done to properly close
the connections when the master server is shut down.
This commit is contained in:
Hornwitser committed 2020-04-09 19:50:01 +02:00
1 parent 47ea8f5477
commit 9507608e59
8 files changed
+174 -44

No files matched your search

+6
View File
@@ -78,6 +78,7 @@ before(async function() {
await exec(`node master --config ${masterConfigPath} config set master.http_port 8880`);
await exec(`node master --config ${masterConfigPath} config set master.https_port 4443`);
await exec(`node master --config ${masterConfigPath} config set master.heartbeat_interval 0.25`);
await exec(`node master --config ${masterConfigPath} config set master.connector_shutdown_timeout 2`);
await exec(`node slave --config ${slaveConfigPath} config set slave.id 4`);
await exec(`node slave --config ${slaveConfigPath} config set slave.name slave`);
@@ -106,6 +107,11 @@ after(async function() {
}
});
// Ensure the test processes are stopped.
process.on("exit", () => {
slaveProcess.kill();
masterProcess.kill();
});
module.exports = {