mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-16 15:30:41 +09:00
Fix Windows stop logic
Handle the Factorio server not exiting when encountering an error on Windows and fix the hang detection for .stop().
This commit is contained in:
1 parent
87d14252fc
commit
203f2d2a14
3 files changed
+83
-19
No files matched your search
@@ -167,6 +167,23 @@ describe("Integration of lib/factorio/server", function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe(".start() error handling", function() {
|
||||
it("should handle factorio erroring out", async function() {
|
||||
slowTest(this);
|
||||
log(".start() for error handling");
|
||||
|
||||
await server.start("test.zip");
|
||||
if (!server._rconReady) {
|
||||
await events.once(server, "rcon-ready");
|
||||
}
|
||||
server.sendRcon("/c script.on_nth_tick(1, function() o.o = 1 end)").catch(() => {});
|
||||
|
||||
function discard() { }
|
||||
server.on("error", discard);
|
||||
await new Promise(resolve => server.once("exit", resolve));
|
||||
server.off("error", discard);
|
||||
});
|
||||
});
|
||||
describe(".stop() hang detection", function() {
|
||||
it("should detect factorio hanging on shutdown", async function() {
|
||||
slowTest(this);
|
||||
|
||||
@@ -120,6 +120,17 @@ let testLines = new Map([
|
||||
message: "Saving to _autosave4 (blocking).",
|
||||
}
|
||||
],
|
||||
[
|
||||
" 10.806 Info AppManager.cpp:394: Saving game as C:\\factorio\\saves\\world.zip",
|
||||
{
|
||||
format: "seconds",
|
||||
time: "10.806",
|
||||
type: "log",
|
||||
level: "Info",
|
||||
file: "AppManager.cpp:394",
|
||||
message: "Saving game as C:\\factorio\\saves\\world.zip",
|
||||
}
|
||||
],
|
||||
[
|
||||
"4202.780 Info AppManagerStates.cpp:1802: Saving finished",
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user