it("returns a baseline status request even when no explicit work is queued", () => { const drained = drainNodePendingWork("node-1");
expect(drained.items).toEqual([
expect.objectContaining({
id: "baseline-status",
type: "status.request",
priority: "default",
}),
]);
expect(drained.hasMore).toBe(false);
});
it("dedupes explicit work by type and removes acknowledged items", () => { const first = enqueueNodePendingWork({ nodeId: "node-2", type: "location.request" }); const second = enqueueNodePendingWork({ nodeId: "node-2", type: "location.request" });
it("keeps hasMore true when the baseline status item is deferred by maxItems", () => {
enqueueNodePendingWork({ nodeId: "node-3", type: "location.request" });
it("prunes the state entry once all explicit items are acknowledged", () => { const { item } = enqueueNodePendingWork({ nodeId: "node-5", type: "status.request" });
expect(getNodePendingWorkStateCountForTests()).toBe(1);
it("prunes the state entry when all items expire naturally via drain", () => {
enqueueNodePendingWork({ nodeId: "node-6", type: "location.request", expiresInMs: 5_000 });
expect(getNodePendingWorkStateCountForTests()).toBe(1);
// Drain well after the item has expired (Date.now() + 60s > enqueue time + 5s)
drainNodePendingWork("node-6", { nowMs: Date.now() + 60_000 });
expect(getNodePendingWorkStateCountForTests()).toBe(0);
});
});
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.