Don't try stopping if instance is already stopped (#401)

Ignore stop if instance status is already stopped. Fixes instance status
getting stuck at stopping if Factorio exits during startup due to the
stopped status having already been sent at the time stop is invoked.

Fixes #400
This commit is contained in:
Hornwitser authored and GitHub committed 2021-08-03 16:08:16 +02:00
1 parent dbe623c9a7
commit f2c9cd0c62
2 files changed
+16 -6

No files matched your search

+11
View File
@@ -253,6 +253,17 @@ describe("Integration of Clusterio", function() {
await execCtl("instance config set 44 factorio.version latest");
}
});
it("should not leave the instance in the stopping state if it fails", async function() {
slowTest(this);
try {
await execCtl("instance config set 44 factorio.game_port 100000");
await assert.rejects(execCtl("instance start test"));
await checkInstanceStatus(44, "stopped");
} finally {
await execCtl("instance config set 44 factorio.game_port");
}
});
it("starts the given save", async function() {
slowTest(this);
await execCtl("instance start test --save world.zip");