Set status to unknown on slave disconnect

Change the instance status to unknown if the slave it's connected to
is disconnected rather than leaving them at their previous state
indefinitely.
This commit is contained in:
Hornwitser committed 2021-09-11 17:12:06 +02:00
1 parent c9ae964eee
commit c59267d5ee
3 files changed
+21 -2

No files matched your search

+4 -1
View File
@@ -88,6 +88,9 @@ describe("Integration of Clusterio", function() {
slaveProcess = await spawn(
"alt-slave:", `node ../../packages/slave run --config ${config}`, /Started slave/
);
// Add instance to test the unknown status afterwards
await execCtl("instance create alt-test --id 99");
await execCtl("instance assign alt-test 5");
} finally {
if (slaveProcess) {
slaveProcess.kill("SIGINT");
@@ -524,7 +527,7 @@ describe("Integration of Clusterio", function() {
describe("instanceUpdateEventHandler()", function() {
it("should have triggered for the previous instance status updates", function() {
let statusesToCheck = new Set([
"unassigned", "stopped", "creating_save", "exporting_data",
"unassigned", "unknown", "stopped", "creating_save", "exporting_data",
"starting", "running", "stopping", "deleted",
]);
let statusesNotSeen = new Set(statusesToCheck);