Files
openclaw/extensions/qa-lab/src/suite-runtime-gateway.test.ts
Gustavo Madeira Santana 4db162db7f QA: split lab runtime and extend Matrix coverage (#67430)
Merged via squash.

Prepared head SHA: 790418b93b
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-16 03:08:39 -04:00

23 lines
928 B
TypeScript

import { describe, expect, it } from "vitest";
import { getGatewayRetryAfterMs, isConfigHashConflict } from "./suite-runtime-gateway.js";
describe("qa suite gateway helpers", () => {
it("reads retry-after from the primary gateway error before appended logs", () => {
const error = new Error(
"rate limit exceeded for config.patch; retry after 38s\nGateway logs:\nprevious config changed since last load",
);
expect(getGatewayRetryAfterMs(error)).toBe(38_000);
expect(isConfigHashConflict(error)).toBe(false);
});
it("ignores stale retry-after text that only appears in appended gateway logs", () => {
const error = new Error(
"config changed since last load; re-run config.get and retry\nGateway logs:\nold rate limit exceeded for config.patch; retry after 38s",
);
expect(getGatewayRetryAfterMs(error)).toBe(null);
expect(isConfigHashConflict(error)).toBe(true);
});
});