fix(agent): bound SCADA presentation continuations
This commit is contained in:
@@ -27,6 +27,17 @@ it("continues an incomplete SCADA presentation with the exact missing device ins
|
||||
expect(scadaPresentationContinuation(new Error("transport failed"))).toBeNull();
|
||||
});
|
||||
|
||||
it("bounds repeated incomplete-presentation continuations within one run", async () => {
|
||||
const { createScadaPresentationContinuation } = await import("../../src/product/operational-task-client.js");
|
||||
const resume = createScadaPresentationContinuation();
|
||||
const rejection = new OperationalTaskClientError(409, "缺少设备:524529", "SCADA_PRESENTATION_INCOMPLETE");
|
||||
expect(resume(new Error("transport failed"))).toBeNull();
|
||||
for (let attempt = 0; attempt < 3; attempt++) expect(resume(rejection)).toContain("524529");
|
||||
expect(resume(rejection)).toBeNull();
|
||||
expect(resume(rejection)).toBeNull();
|
||||
expect(createScadaPresentationContinuation()(rejection)).toContain("524529");
|
||||
});
|
||||
|
||||
|
||||
it("keeps all-null current chunks aligned to their own first slot across midnight", () => {
|
||||
for (const [start, end, labels, times] of [
|
||||
|
||||
Reference in New Issue
Block a user