mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:10:44 +00:00
test: relax live web search timeouts
This commit is contained in:
@@ -5,6 +5,7 @@ import { createKimiWebSearchProvider } from "./src/kimi-web-search-provider.js";
|
||||
const KIMI_SEARCH_KEY =
|
||||
process.env.KIMI_API_KEY?.trim() || process.env.MOONSHOT_API_KEY?.trim() || "";
|
||||
const describeLive = isLiveTestEnabled() && KIMI_SEARCH_KEY.length > 0 ? describe : describe.skip;
|
||||
const KIMI_LIVE_SEARCH_TIMEOUT_SECONDS = 60;
|
||||
|
||||
function isTransientKimiSearchError(error: unknown): boolean {
|
||||
if (!(error instanceof Error)) {
|
||||
@@ -22,7 +23,11 @@ describeLive("moonshot plugin live", () => {
|
||||
const provider = createKimiWebSearchProvider();
|
||||
const tool = provider.createTool?.({
|
||||
config: {},
|
||||
searchConfig: { kimi: { apiKey: KIMI_SEARCH_KEY }, cacheTtlMinutes: 0, timeoutSeconds: 20 },
|
||||
searchConfig: {
|
||||
kimi: { apiKey: KIMI_SEARCH_KEY },
|
||||
cacheTtlMinutes: 0,
|
||||
timeoutSeconds: KIMI_LIVE_SEARCH_TIMEOUT_SECONDS,
|
||||
},
|
||||
} as never);
|
||||
|
||||
let result: { provider?: string; content?: unknown; citations?: unknown } | undefined;
|
||||
@@ -47,5 +52,5 @@ describeLive("moonshot plugin live", () => {
|
||||
expect(typeof result?.content).toBe("string");
|
||||
expect((result?.content as string).length).toBeGreaterThan(20);
|
||||
expect(Array.isArray(result?.citations)).toBe(true);
|
||||
}, 60_000);
|
||||
}, 180_000);
|
||||
});
|
||||
|
||||
@@ -11,6 +11,7 @@ import { createWebSearchTool } from "./tools/web-search.js";
|
||||
|
||||
const XAI_KEY = process.env.XAI_API_KEY ?? "";
|
||||
const LIVE = isLiveTestEnabled(["XAI_LIVE_TEST"]);
|
||||
const XAI_WEB_SEARCH_LIVE_TIMEOUT_SECONDS = 60;
|
||||
|
||||
const describeLive = LIVE && XAI_KEY ? describe : describe.skip;
|
||||
|
||||
@@ -133,6 +134,7 @@ describeLive("xai live", () => {
|
||||
web: {
|
||||
search: {
|
||||
provider: "grok",
|
||||
timeoutSeconds: XAI_WEB_SEARCH_LIVE_TIMEOUT_SECONDS,
|
||||
grok: {
|
||||
model: "grok-4-1-fast",
|
||||
},
|
||||
@@ -165,5 +167,5 @@ describeLive("xai live", () => {
|
||||
(Array.isArray(details.citations) ? details.citations.length : 0) +
|
||||
(Array.isArray(details.inlineCitations) ? details.inlineCitations.length : 0);
|
||||
expect(citationCount).toBeGreaterThan(0);
|
||||
}, 45_000);
|
||||
}, 90_000);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user