From db492575c885977a0b301c175c91a3ff65dbaff1 Mon Sep 17 00:00:00 2001 From: 190n Date: Tue, 25 Mar 2025 18:20:08 -0700 Subject: [PATCH] Skip flaky macOS x64 node-napi tests in CI (v2) (#18468) --- test/napi/node-napi.test.ts | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/test/napi/node-napi.test.ts b/test/napi/node-napi.test.ts index 8820d237fc..3f29235d45 100644 --- a/test/napi/node-napi.test.ts +++ b/test/napi/node-napi.test.ts @@ -1,6 +1,6 @@ import { spawnSync, spawn, Glob } from "bun"; import { beforeAll, describe, expect, it } from "bun:test"; -import { bunEnv, bunExe, isBroken, isCI, isIntelMacOS, isMusl } from "harness"; +import { bunEnv, bunExe, isBroken, isCI, isIntelMacOS, isMusl, isWindows } from "harness"; import { join, dirname } from "path"; import os from "node:os"; @@ -17,12 +17,6 @@ let failingJsNativeApiTests: string[] = [ // "test_string/test.js", ]; -if (isBroken && isIntelMacOS) { - // TODO(@190n) - // these are flaky on Intel Mac - failingJsNativeApiTests.push("test_reference_by_node_api_version/test.js", "test_reference/test.js"); -} - // These are the tests from node-api that failed as of commit 83f536f4d, except for those that // passed in Bun v1.1.34. It'll take some time to get all these to work, as we've been focusing more // on js-native-api tests so far, and we don't want these tests to pollute CI. But we do want to @@ -56,8 +50,17 @@ let failingNodeApiTests = [ "test_worker_terminate/test.js", ]; -if (process.platform == "win32") { - failingNodeApiTests.push("test_callback_scope/test.js"); // TODO: remove once #12827 is fixed +if (isBroken && isIntelMacOS) { + // TODO(@190n) + // these are flaky on Intel Mac + failingJsNativeApiTests.push("test_reference/test.js"); + failingNodeApiTests.push("test_reference_by_node_api_version/test.js"); +} + +if (isWindows) { + if (isBroken) { + failingNodeApiTests.push("test_callback_scope/test.js"); // TODO: remove once #12827 is fixed + } for (const i in failingJsNativeApiTests) { failingJsNativeApiTests[i] = failingJsNativeApiTests[i].replaceAll("/", "\\"); @@ -72,6 +75,19 @@ if (isMusl) { failingJsNativeApiTests = jsNativeApiTests; } +for (const t of failingJsNativeApiTests) { + if (!jsNativeApiTests.includes(t)) { + console.error(`attempt to skip ${t} which is not a real js-native-api test`); + process.exit(1); + } +} +for (const t of failingNodeApiTests) { + if (!nodeApiTests.includes(t)) { + console.error(`attempt to skip ${t} which is not a real node-api test`); + process.exit(1); + } +} + beforeAll(async () => { const directories = jsNativeApiTests .filter(t => !failingJsNativeApiTests.includes(t))