Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

test: stabilize Windows CI subprocess timing (#344)

mldangelo-oaic475ef36a299
diff --git a/sdk/typescript/tests-ts/release-automation.test.ts b/sdk/typescript/tests-ts/release-automation.test.ts
index 7c4a4b6aa..51c35e4bf 100644
--- a/sdk/typescript/tests-ts/release-automation.test.ts
+++ b/sdk/typescript/tests-ts/release-automation.test.ts
@@ -139,6 +139,7 @@ const {
const releaseCommit = "1e03c89ad22d2df5ae65b146be1483b3608572a9";
const releaseRun = "30481596229";
const releaseRepository = "openai/codex-security";
+const releaseTagTimeout = process.platform === "win32" ? 20_000 : 10_000;
const releaseSigningCertificate =
"MIIHOjCCBr+gAwIBAgIUDDD6xE6tccKRAzn6GcB6Ajvw2+swCgYIKoZIzj0EAwMwNzEVMBMGA1UEChMMc2lnc3Rv" +
"cmUuZGV2MR4wHAYDVQQDExVzaWdzdG9yZS1pbnRlcm1lZGlhdGUwHhcNMjYwNzI5MTg1MTA1WhcNMjYwNzI5MTkw" +
@@ -1700,7 +1701,7 @@ describe("GitHub release workflow safeguards", () => {
RELEASE_SHA: releaseCommit,
RELEASE_TAG: "npm-v0.1.2",
},
- timeout: 10_000,
+ timeout: releaseTagTimeout,
});
expect(result.status).toBe(0);
@@ -1769,7 +1770,7 @@ describe("GitHub release workflow safeguards", () => {
MOCK_LOOKUP_RESPONSE: lookupResponse,
RELEASE_TAG: "npm-v0.1.2",
},
- timeout: 10_000,
+ timeout: releaseTagTimeout,
});
expect(result.status).toBe(status);
@@ -1846,7 +1847,7 @@ describe("GitHub release workflow safeguards", () => {
MOCK_TAG_TYPE: tagType,
RELEASE_TAG: "npm-v0.1.2",
},
- timeout: 10_000,
+ timeout: releaseTagTimeout,
});
expect(result.status).toBe(status);
diff --git a/sdk/typescript/tests-ts/runtime.test.ts b/sdk/typescript/tests-ts/runtime.test.ts
index 22c3060f3..8176d95a9 100644
--- a/sdk/typescript/tests-ts/runtime.test.ts
+++ b/sdk/typescript/tests-ts/runtime.test.ts
@@ -2801,7 +2801,7 @@ describe("runtime directories and plugin Python boundary", () => {
{
encoding: "utf8",
env: { ...process.env, CODEX_SECURITY_TEST_ACL_PATH: home },
- timeout: 15_000,
+ timeout: 20_000,
windowsHide: true,
},
);
diff --git a/sdk/typescript/tests-ts/scan-recovery.test.ts b/sdk/typescript/tests-ts/scan-recovery.test.ts
index 153e5d4b3..1dfb7cba9 100644
--- a/sdk/typescript/tests-ts/scan-recovery.test.ts
+++ b/sdk/typescript/tests-ts/scan-recovery.test.ts
@@ -615,59 +615,58 @@ describe("malformed scan artifact recovery", () => {
expect(coverage.deferred).toHaveLength(4);
});
- test("retains the strongest duplicate finding regardless of input order", async () => {
- const cases = [
- {
- name: "severity ascending",
- candidates: [
- ["informational", "high", 1],
- ["critical", "high", 1],
- ],
- expected: ["critical", "high", 1],
- },
- {
- name: "severity descending",
- candidates: [
- ["critical", "high", 1],
- ["informational", "high", 1],
- ],
- expected: ["critical", "high", 1],
- },
- {
- name: "confidence ascending",
- candidates: [
- ["critical", "low", 1],
- ["critical", "high", 1],
- ],
- expected: ["critical", "high", 1],
- },
- {
- name: "confidence descending",
- candidates: [
- ["critical", "high", 1],
- ["critical", "low", 1],
- ],
- expected: ["critical", "high", 1],
- },
- {
- name: "evidence ascending",
- candidates: [
- ["critical", "high", 1],
- ["critical", "high", 2],
- ],
- expected: ["critical", "high", 2],
- },
- {
- name: "evidence descending",
- candidates: [
- ["critical", "high", 2],
- ["critical", "high", 1],
- ],
- expected: ["critical", "high", 2],
- },
- ] as const;
-
- for (const { name, candidates, expected } of cases) {
+ test.each([
+ {
+ name: "severity ascending",
+ candidates: [
+ ["informational", "high", 1],
+ ["critical", "high", 1],
+ ],
+ expected: ["critical", "high", 1],
+ },
+ {
+ name: "severity descending",
+ candidates: [
+ ["critical", "high", 1],
+ ["informational", "high", 1],
+ ],
+ expected: ["critical", "high", 1],
+ },
+ {
+ name: "confidence ascending",
+ candidates: [
+ ["critical", "low", 1],
+ ["critical", "high", 1],
+ ],
+ expected: ["critical", "high", 1],
+ },
+ {
+ name: "confidence descending",
+ candidates: [
+ ["critical", "high", 1],
+ ["critical", "low", 1],
+ ],
+ expected: ["critical", "high", 1],
+ },
+ {
+ name: "evidence ascending",
+ candidates: [
+ ["critical", "high", 1],
+ ["critical", "high", 2],
+ ],
+ expected: ["critical", "high", 2],
+ },
+ {
+ name: "evidence descending",
+ candidates: [
+ ["critical", "high", 2],
+ ["critical", "high", 1],
+ ],
+ expected: ["critical", "high", 2],
+ },
+ ] as const)(
+ "retains the strongest duplicate finding with $name input order",
+ async ({ name, candidates, expected }) => {
const fixture = await startDraftScan();
const path = join(fixture.scanDir, "findings.json");
const document = await readJson<FindingsDocument>(path);
@@ -719,8 +718,8 @@ describe("malformed scan artifact recovery", () => {
expect(sarif.runs[0]?.results[0]?.properties.severity, name).toBe(
"critical",
);
- }
- });
+ },
+ );
test("completes scans when every draft finding is malformed", async () => {
const fixture = await startDraftScan();