mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-03 05:12:15 +00:00
test(ci): fix stale regression expectations (#57899)
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user