fix(test-planner): shrink local extension batches on constrained hosts

This commit is contained in:
Tak Hoffman
2026-03-27 01:58:58 -05:00
parent cfddce4196
commit 6f92148da9
2 changed files with 37 additions and 1 deletions

View File

@@ -50,6 +50,38 @@ describe("test planner", () => {
artifacts.cleanupTempArtifacts();
});
it("uses smaller shared extension batches on constrained local hosts", () => {
const env = {
RUNNER_OS: "macOS",
OPENCLAW_TEST_HOST_CPU_COUNT: "8",
OPENCLAW_TEST_HOST_MEMORY_GIB: "16",
OPENCLAW_TEST_LOAD_AWARE: "0",
};
const artifacts = createExecutionArtifacts(env);
const plan = buildExecutionPlan(
{
profile: null,
mode: "local",
surfaces: ["extensions"],
passthroughArgs: [],
},
{
env,
platform: "darwin",
writeTempJsonArtifact: artifacts.writeTempJsonArtifact,
},
);
const sharedExtensionBatches = plan.selectedUnits.filter((unit) =>
unit.id.startsWith("extensions-batch-"),
);
expect(plan.runtimeCapabilities.memoryBand).toBe("constrained");
expect(plan.executionBudget.extensionsBatchTargetMs).toBe(60_000);
expect(sharedExtensionBatches.length).toBeGreaterThan(3);
artifacts.cleanupTempArtifacts();
});
it("scales down mid-tier local concurrency under saturated load", () => {
const artifacts = createExecutionArtifacts({
RUNNER_OS: "Linux",