perf(test): isolate memory-heavy extension hotspots (#59879)

* perf(test): isolate memory-heavy extension hotspots

* fix(test): pin extension memory hotspot threshold
This commit is contained in:
Vincent Koc
2026-04-03 13:01:09 +09:00
committed by GitHub
parent e3674bcc04
commit 98137f7f80
6 changed files with 182 additions and 32 deletions

View File

@@ -175,6 +175,38 @@ describe("test planner", () => {
artifacts.cleanupTempArtifacts();
});
it("auto-isolates memory-heavy extension suites in CI", () => {
const env = {
CI: "true",
GITHUB_ACTIONS: "true",
RUNNER_OS: "Linux",
OPENCLAW_TEST_HOST_CPU_COUNT: "4",
OPENCLAW_TEST_HOST_MEMORY_GIB: "16",
};
const artifacts = createExecutionArtifacts(env);
const plan = buildExecutionPlan(
{
profile: null,
mode: "ci",
surfaces: ["extensions"],
passthroughArgs: [],
},
{
env,
platform: "linux",
writeTempJsonArtifact: artifacts.writeTempJsonArtifact,
},
);
const hotspotFile = bundledPluginFile("feishu", "src/bot.test.ts");
const hotspotUnit = plan.selectedUnits.find((unit) => unit.args.includes(hotspotFile));
expect(hotspotUnit).toBeTruthy();
expect(hotspotUnit?.isolate).toBe(true);
expect(hotspotUnit?.reasons).toContain("extensions-memory-heavy");
artifacts.cleanupTempArtifacts();
});
it("auto-isolates timed-heavy channel suites in CI", () => {
const env = {
CI: "true",