

















@@ -227,7 +227,7 @@ describe("local-heavy-check-runtime", () => {
227227});
228228229229it("serializes local oxlint runs onto one thread on constrained hosts", () => {
230-const { args } = applyLocalOxlintPolicy([], makeEnv(), CONSTRAINED_HOST);
230+const { args, env } = applyLocalOxlintPolicy([], makeEnv(), CONSTRAINED_HOST);
231231232232expect(args).toEqual([
233233"--type-aware",
@@ -237,10 +237,12 @@ describe("local-heavy-check-runtime", () => {
237237"error",
238238"--threads=1",
239239]);
240+expect(env.GOGC).toBe("30");
241+expect(env.GOMEMLIMIT).toBe("3GiB");
240242});
241243242244it("defaults local oxlint to one thread on roomy hosts", () => {
243-const { args } = applyLocalOxlintPolicy([], makeEnv(), ROOMY_HOST);
245+const { args, env } = applyLocalOxlintPolicy([], makeEnv(), ROOMY_HOST);
244246245247expect(args).toEqual([
246248"--type-aware",
@@ -250,10 +252,16 @@ describe("local-heavy-check-runtime", () => {
250252"error",
251253"--threads=1",
252254]);
255+expect(env.GOGC).toBe("30");
256+expect(env.GOMEMLIMIT).toBe("3GiB");
253257});
254258255259it("honors an explicit oxlint thread count", () => {
256-const { args } = applyLocalOxlintPolicy(["--threads=8"], makeEnv(), ROOMY_HOST);
260+const { args, env } = applyLocalOxlintPolicy(
261+["--threads=8"],
262+makeEnv({ GOGC: "80", GOMEMLIMIT: "5GiB" }),
263+ROOMY_HOST,
264+);
257265258266expect(args).toEqual([
259267"--threads=8",
@@ -263,10 +271,12 @@ describe("local-heavy-check-runtime", () => {
263271"--report-unused-disable-directives-severity",
264272"error",
265273]);
274+expect(env.GOGC).toBe("80");
275+expect(env.GOMEMLIMIT).toBe("5GiB");
266276});
267277268278it("allows forcing full-speed oxlint runs on roomy hosts", () => {
269-const { args } = applyLocalOxlintPolicy(
279+const { args, env } = applyLocalOxlintPolicy(
270280[],
271281makeEnv({
272282OPENCLAW_LOCAL_CHECK_MODE: "full",
@@ -281,6 +291,8 @@ describe("local-heavy-check-runtime", () => {
281291"--report-unused-disable-directives-severity",
282292"error",
283293]);
294+expect(env.GOGC).toBeUndefined();
295+expect(env.GOMEMLIMIT).toBeUndefined();
284296});
285297286298it("skips the heavy-check lock for explicit oxlint file targets", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。