mirror of
https://github.com/openai/codex.git
synced 2026-11-24 23:20:47 +00:00
fix(macos): scrub malloc diagnostic env
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import { sanitizeMacosMallocDiagnosticEnv } from "../bin/sanitize-macos-malloc-env.js";
|
||||
|
||||
test("removes macOS malloc diagnostic env vars on darwin", () => {
|
||||
const env = {
|
||||
MallocStackLogging: "0",
|
||||
MallocStackLoggingDirectory: "/tmp/stack-logs",
|
||||
MallocLogFile: "/tmp/malloc.log",
|
||||
MallocNanoZone: "0",
|
||||
PATH: "/usr/bin",
|
||||
};
|
||||
|
||||
sanitizeMacosMallocDiagnosticEnv(env, "darwin");
|
||||
|
||||
assert.deepEqual(env, {
|
||||
MallocNanoZone: "0",
|
||||
PATH: "/usr/bin",
|
||||
});
|
||||
});
|
||||
|
||||
test("leaves env unchanged off darwin", () => {
|
||||
const env = {
|
||||
MallocStackLogging: "0",
|
||||
PATH: "/usr/bin",
|
||||
};
|
||||
|
||||
sanitizeMacosMallocDiagnosticEnv(env, "linux");
|
||||
|
||||
assert.deepEqual(env, {
|
||||
MallocStackLogging: "0",
|
||||
PATH: "/usr/bin",
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user