fix(e2e): cancel RPC RTT probe bodies · openclaw/openclaw@32ee308
vincentkoc
·
2026-06-19
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -580,4 +580,45 @@ describe("scripts/measure-rpc-rtt.mjs", () => {
|
580 | 580 | }), |
581 | 581 | ); |
582 | 582 | }); |
| 583 | + |
| 584 | +it("cancels unconsumed readiness probe response bodies", async () => { |
| 585 | +const child = new EventEmitter(); |
| 586 | +let readyzCanceled = false; |
| 587 | +let healthzCanceled = false; |
| 588 | +const fetchImpl = vi |
| 589 | +.fn() |
| 590 | +.mockResolvedValueOnce({ |
| 591 | +body: { |
| 592 | +async cancel() { |
| 593 | +readyzCanceled = true; |
| 594 | +}, |
| 595 | +}, |
| 596 | +ok: false, |
| 597 | +status: 503, |
| 598 | +}) |
| 599 | +.mockResolvedValueOnce({ |
| 600 | +body: { |
| 601 | +async cancel() { |
| 602 | +healthzCanceled = true; |
| 603 | +}, |
| 604 | +}, |
| 605 | +ok: true, |
| 606 | +status: 200, |
| 607 | +}) |
| 608 | +.mockResolvedValueOnce(jsonResponse({ failing: [], ready: true })); |
| 609 | + |
| 610 | +await waitForGatewayReady({ |
| 611 | + child, |
| 612 | + fetchImpl, |
| 613 | +port: 12345, |
| 614 | +probeTimeoutMs: 7, |
| 615 | +readyTimeoutMs: 50, |
| 616 | +sleepMs: 1, |
| 617 | +stderrPath: "/no/such/stderr.log", |
| 618 | +}); |
| 619 | + |
| 620 | +expect(fetchImpl).toHaveBeenCalledTimes(3); |
| 621 | +expect(readyzCanceled).toBe(true); |
| 622 | +expect(healthzCanceled).toBe(true); |
| 623 | +}); |
583 | 624 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。