mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 15:33:12 +09:00
Fix statistics_exporter sending commands before start
Fix statistics_exporter potentially sending commands before an instance is started when metrics are collected.
This commit is contained in:
1 parent
c40362fa7f
commit
2b101d594a
3 files changed
+12
No files matched your search
@@ -17,7 +17,14 @@ describe("statistics_exporter plugin", function() {
|
||||
});
|
||||
|
||||
describe(".onMetrics()", function() {
|
||||
it("should not send commands before running", async function() {
|
||||
instancePlugin.instance.server.rconCommands.length = 0;
|
||||
instancePlugin.instance.status = "starting";
|
||||
await instancePlugin.onMetrics();
|
||||
assert(instancePlugin.instance.server.rconCommands.length === 0, "commands were run");
|
||||
});
|
||||
it("should record statistics", async function() {
|
||||
instancePlugin.instance.status = "running";
|
||||
instancePlugin.instance.server.rconCommandResults.set(
|
||||
"/sc statistics_exporter.export()",
|
||||
JSON.stringify({
|
||||
|
||||
Reference in new issue
Block a user