Fix hang on missing/wrong Factorio version

Fix the start command hanging if the configured Factorio version for the
instance started is not available on the slave.
This commit is contained in:
Hornwitser committed 2021-06-01 16:38:58 +02:00
1 parent a0f5864324
commit 09e4256c18
2 files changed
+16 -1

No files matched your search

+6 -1
View File
@@ -315,7 +315,12 @@ class Instance extends libLink.Link {
async init(pluginInfos) {
this.notifyStatus("starting");
await this.server.init();
try {
await this.server.init();
} catch (err) {
this.notifyExit();
throw err;
}
// load plugins
for (let pluginInfo of pluginInfos) {
+10
View File
@@ -173,6 +173,16 @@ describe("Integration of Clusterio", function() {
});
describe("instance start", function() {
it("should not hang if factorio version does not exist", async function() {
slowTest(this);
try {
await execCtl("instance config set 44 factorio.version 0.1.2");
await assert.rejects(execCtl("instance start test"));
} finally {
await execCtl("instance config set 44 factorio.version latest");
}
});
it("starts the given save", async function() {
slowTest(this);
await execCtl("instance start test --save world.zip");