mirror of https://github.com/openclaw/openclaw.git
test(ci): fix stale regression expectations (#57899)
This commit is contained in:
parent
4a6267bfe1
commit
9c25544e6c
|
|
@ -676,7 +676,16 @@ describe("discord component interactions", () => {
|
|||
duplicate: false,
|
||||
});
|
||||
|
||||
const button = createDiscordComponentButton(createComponentContext());
|
||||
const button = createDiscordComponentButton(
|
||||
createComponentContext({
|
||||
discordConfig: createDiscordConfig({
|
||||
dm: {
|
||||
groupEnabled: true,
|
||||
groupChannels: ["group-dm-1"],
|
||||
},
|
||||
}),
|
||||
}),
|
||||
);
|
||||
const { interaction } = createComponentButtonInteraction({
|
||||
rawData: {
|
||||
channel_id: "group-dm-1",
|
||||
|
|
|
|||
|
|
@ -1742,7 +1742,7 @@ describe("QmdMemoryManager", () => {
|
|||
.filter((args: string[]) => args[0] === "search");
|
||||
expect(searchCalls).toEqual([
|
||||
["search", "test", "--json", "-n", String(maxResults), "-c", "workspace-main"],
|
||||
["search", "test", "--json", "-n", String(maxResults), "-c", "notes-main"],
|
||||
["search", "test", "--json", "-n", String(maxResults), "-c", "notes"],
|
||||
]);
|
||||
await manager.close();
|
||||
});
|
||||
|
|
@ -1828,7 +1828,7 @@ describe("QmdMemoryManager", () => {
|
|||
.filter((args: string[]) => args[0] === "query");
|
||||
expect(queryCalls).toEqual([
|
||||
["query", "test", "--json", "-n", String(maxResults), "-c", "workspace-main"],
|
||||
["query", "test", "--json", "-n", String(maxResults), "-c", "notes-main"],
|
||||
["query", "test", "--json", "-n", String(maxResults), "-c", "notes"],
|
||||
]);
|
||||
await manager.close();
|
||||
});
|
||||
|
|
@ -1880,7 +1880,7 @@ describe("QmdMemoryManager", () => {
|
|||
expect(searchAndQueryCalls).toEqual([
|
||||
["search", "test", "--json", "-n", String(maxResults), "-c", "workspace-main"],
|
||||
["query", "test", "--json", "-n", String(maxResults), "-c", "workspace-main"],
|
||||
["query", "test", "--json", "-n", String(maxResults), "-c", "notes-main"],
|
||||
["query", "test", "--json", "-n", String(maxResults), "-c", "notes"],
|
||||
]);
|
||||
await manager.close();
|
||||
});
|
||||
|
|
@ -2217,7 +2217,7 @@ describe("QmdMemoryManager", () => {
|
|||
await manager.search("hello", { sessionKey: "agent:main:slack:dm:u123" });
|
||||
|
||||
expect(selectors).toEqual(["qmd.hybrid_search", "qmd.hybrid_search"]);
|
||||
expect(collections).toEqual(["workspace-a-main", "workspace-b-main"]);
|
||||
expect(collections).toEqual(["workspace-a", "workspace-b"]);
|
||||
|
||||
await manager.close();
|
||||
});
|
||||
|
|
@ -3326,7 +3326,7 @@ describe("QmdMemoryManager", () => {
|
|||
);
|
||||
return child;
|
||||
}
|
||||
if (args[0] === "search" && args.includes("notes-main")) {
|
||||
if (args[0] === "search" && args.includes("notes")) {
|
||||
const child = createMockChild({ autoClose: false });
|
||||
emitAndClose(child, "stdout", "[]");
|
||||
return child;
|
||||
|
|
@ -3542,14 +3542,14 @@ describe("QmdMemoryManager", () => {
|
|||
);
|
||||
return child;
|
||||
}
|
||||
if (args[0] === "search" && args.includes("notes-main")) {
|
||||
if (args[0] === "search" && args.includes("notes")) {
|
||||
const child = createMockChild({ autoClose: false });
|
||||
emitAndClose(
|
||||
child,
|
||||
"stdout",
|
||||
JSON.stringify([
|
||||
{
|
||||
file: "qmd://notes-main/guide.md",
|
||||
file: "qmd://notes/guide.md",
|
||||
score: 0.7,
|
||||
snippet: "@@ -1,1\nnotes guide",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -120,12 +120,33 @@ describe("test planner", () => {
|
|||
});
|
||||
|
||||
it("scales down mid-tier local concurrency under saturated load", () => {
|
||||
const artifacts = createExecutionArtifacts({
|
||||
const env = {
|
||||
RUNNER_OS: "Linux",
|
||||
OPENCLAW_TEST_HOST_CPU_COUNT: "10",
|
||||
OPENCLAW_TEST_HOST_MEMORY_GIB: "64",
|
||||
};
|
||||
const baselineArtifacts = createExecutionArtifacts({
|
||||
...env,
|
||||
OPENCLAW_TEST_LOAD_AWARE: "0",
|
||||
});
|
||||
const plan = buildExecutionPlan(
|
||||
const baselinePlan = buildExecutionPlan(
|
||||
{
|
||||
profile: null,
|
||||
mode: "local",
|
||||
surfaces: ["unit", "extensions"],
|
||||
passthroughArgs: [],
|
||||
},
|
||||
{
|
||||
env: {
|
||||
...env,
|
||||
OPENCLAW_TEST_LOAD_AWARE: "0",
|
||||
},
|
||||
platform: "linux",
|
||||
writeTempJsonArtifact: baselineArtifacts.writeTempJsonArtifact,
|
||||
},
|
||||
);
|
||||
const saturatedArtifacts = createExecutionArtifacts(env);
|
||||
const saturatedPlan = buildExecutionPlan(
|
||||
{
|
||||
profile: null,
|
||||
mode: "local",
|
||||
|
|
@ -140,19 +161,26 @@ describe("test planner", () => {
|
|||
},
|
||||
platform: "linux",
|
||||
loadAverage: [11.5, 11.5, 11.5],
|
||||
writeTempJsonArtifact: artifacts.writeTempJsonArtifact,
|
||||
writeTempJsonArtifact: saturatedArtifacts.writeTempJsonArtifact,
|
||||
},
|
||||
);
|
||||
|
||||
expect(plan.runtimeCapabilities.memoryBand).toBe("mid");
|
||||
expect(plan.runtimeCapabilities.loadBand).toBe("saturated");
|
||||
expect(plan.executionBudget.unitSharedWorkers).toBe(2);
|
||||
expect(plan.executionBudget.unitIsolatedWorkers).toBe(1);
|
||||
expect(plan.executionBudget.topLevelParallelLimitNoIsolate).toBe(4);
|
||||
expect(plan.executionBudget.topLevelParallelLimitIsolated).toBe(1);
|
||||
expect(plan.topLevelParallelLimit).toBe(4);
|
||||
expect(plan.deferredRunConcurrency).toBe(1);
|
||||
artifacts.cleanupTempArtifacts();
|
||||
expect(saturatedPlan.runtimeCapabilities.memoryBand).toBe("mid");
|
||||
expect(saturatedPlan.runtimeCapabilities.loadBand).toBe("saturated");
|
||||
expect(saturatedPlan.executionBudget.unitSharedWorkers).toBe(2);
|
||||
expect(saturatedPlan.executionBudget.unitSharedWorkers).toBeLessThan(
|
||||
baselinePlan.executionBudget.unitSharedWorkers,
|
||||
);
|
||||
expect(saturatedPlan.executionBudget.unitIsolatedWorkers).toBe(1);
|
||||
expect(saturatedPlan.executionBudget.topLevelParallelLimitNoIsolate).toBe(4);
|
||||
expect(saturatedPlan.executionBudget.topLevelParallelLimitIsolated).toBe(1);
|
||||
expect(saturatedPlan.topLevelParallelLimit).toBeLessThan(baselinePlan.topLevelParallelLimit);
|
||||
expect(saturatedPlan.topLevelParallelLimit).toBeLessThanOrEqual(
|
||||
saturatedPlan.executionBudget.topLevelParallelLimitNoIsolate,
|
||||
);
|
||||
expect(saturatedPlan.deferredRunConcurrency).toBe(1);
|
||||
baselineArtifacts.cleanupTempArtifacts();
|
||||
saturatedArtifacts.cleanupTempArtifacts();
|
||||
});
|
||||
|
||||
it("coalesces saturated high-memory local unit bursts into fewer shared batches", () => {
|
||||
|
|
@ -161,8 +189,28 @@ describe("test planner", () => {
|
|||
OPENCLAW_TEST_HOST_CPU_COUNT: "16",
|
||||
OPENCLAW_TEST_HOST_MEMORY_GIB: "128",
|
||||
};
|
||||
const artifacts = createExecutionArtifacts(env);
|
||||
const plan = buildExecutionPlan(
|
||||
const baselineArtifacts = createExecutionArtifacts({
|
||||
...env,
|
||||
OPENCLAW_TEST_LOAD_AWARE: "0",
|
||||
});
|
||||
const baselinePlan = buildExecutionPlan(
|
||||
{
|
||||
profile: null,
|
||||
mode: "local",
|
||||
surfaces: ["unit"],
|
||||
passthroughArgs: [],
|
||||
},
|
||||
{
|
||||
env: {
|
||||
...env,
|
||||
OPENCLAW_TEST_LOAD_AWARE: "0",
|
||||
},
|
||||
platform: "darwin",
|
||||
writeTempJsonArtifact: baselineArtifacts.writeTempJsonArtifact,
|
||||
},
|
||||
);
|
||||
const saturatedArtifacts = createExecutionArtifacts(env);
|
||||
const saturatedPlan = buildExecutionPlan(
|
||||
{
|
||||
profile: null,
|
||||
mode: "local",
|
||||
|
|
@ -173,20 +221,30 @@ describe("test planner", () => {
|
|||
env,
|
||||
platform: "darwin",
|
||||
loadAverage: [18, 18, 18],
|
||||
writeTempJsonArtifact: artifacts.writeTempJsonArtifact,
|
||||
writeTempJsonArtifact: saturatedArtifacts.writeTempJsonArtifact,
|
||||
},
|
||||
);
|
||||
|
||||
const sharedUnitBatches = plan.selectedUnits.filter(
|
||||
const baselineSharedUnitBatches = baselinePlan.selectedUnits.filter(
|
||||
(unit) => unit.surface === "unit" && !unit.isolate && unit.id.startsWith("unit-fast"),
|
||||
);
|
||||
const saturatedSharedUnitBatches = saturatedPlan.selectedUnits.filter(
|
||||
(unit) => unit.surface === "unit" && !unit.isolate && unit.id.startsWith("unit-fast"),
|
||||
);
|
||||
|
||||
expect(plan.runtimeCapabilities.memoryBand).toBe("high");
|
||||
expect(plan.runtimeCapabilities.loadBand).toBe("saturated");
|
||||
expect(sharedUnitBatches).toHaveLength(3);
|
||||
expect(plan.executionBudget.unitIsolatedWorkers).toBe(1);
|
||||
expect(plan.executionBudget.unitFastBatchTargetMs).toBe(90_000);
|
||||
artifacts.cleanupTempArtifacts();
|
||||
expect(saturatedPlan.runtimeCapabilities.memoryBand).toBe("high");
|
||||
expect(saturatedPlan.runtimeCapabilities.loadBand).toBe("saturated");
|
||||
expect(saturatedPlan.executionBudget.unitIsolatedWorkers).toBe(1);
|
||||
expect(saturatedPlan.executionBudget.unitIsolatedWorkers).toBeLessThan(
|
||||
baselinePlan.executionBudget.unitIsolatedWorkers,
|
||||
);
|
||||
expect(saturatedPlan.executionBudget.unitFastBatchTargetMs).toBe(90_000);
|
||||
expect(saturatedPlan.executionBudget.unitFastBatchTargetMs).toBeGreaterThan(
|
||||
baselinePlan.executionBudget.unitFastBatchTargetMs,
|
||||
);
|
||||
expect(saturatedSharedUnitBatches.length).toBeLessThan(baselineSharedUnitBatches.length);
|
||||
baselineArtifacts.cleanupTempArtifacts();
|
||||
saturatedArtifacts.cleanupTempArtifacts();
|
||||
});
|
||||
|
||||
it("keeps full local unit runs phased when isolated and heavy lanes are present", () => {
|
||||
|
|
@ -407,6 +465,7 @@ describe("test planner", () => {
|
|||
OPENCLAW_TEST_SHARDS: "4",
|
||||
OPENCLAW_TEST_SHARD_INDEX: "1",
|
||||
OPENCLAW_TEST_LOAD_AWARE: "0",
|
||||
OPENCLAW_TEST_UNIT_FAST_BATCH_TARGET_MS: "1",
|
||||
};
|
||||
const artifacts = createExecutionArtifacts(env);
|
||||
const plan = buildExecutionPlan(
|
||||
|
|
|
|||
Loading…
Reference in New Issue