Skip to content

Commit 8ebd5d5

Browse files
authored
Skip flaky macOS x64 node-napi tests in CI (#18448)
1 parent 60acfb1 commit 8ebd5d5

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

test/napi/napi.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ describe("napi", () => {
1515
stdin: "inherit",
1616
});
1717
if (!install.success) {
18-
throw new Error("build failed");
18+
console.error("build failed, bailing out!");
19+
process.exit(1);
1920
}
2021
});
2122

test/napi/node-napi.test.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { spawnSync, spawn, Glob } from "bun";
22
import { beforeAll, describe, expect, it } from "bun:test";
3-
import { bunEnv, bunExe, isCI, isMusl } from "harness";
3+
import { bunEnv, bunExe, isBroken, isCI, isIntelMacOS, isMusl } from "harness";
44
import { join, dirname } from "path";
55
import os from "node:os";
66

@@ -11,12 +11,18 @@ const jsNativeApiTests = Array.from(new Glob("**/*.js").scanSync(jsNativeApiRoot
1111
const nodeApiTests = Array.from(new Glob("**/*.js").scanSync(nodeApiRoot));
1212

1313
// These js-native-api tests are known to fail and will be fixed in later PRs
14-
let failingJsNativeApiTests = [
14+
let failingJsNativeApiTests: string[] = [
1515
// We skip certain parts of test_string/test.js because we don't support creating empty external
1616
// strings. We don't skip the entire thing because the other tests are useful to check.
1717
// "test_string/test.js",
1818
];
1919

20+
if (isBroken && isIntelMacOS) {
21+
// TODO(@190n)
22+
// these are flaky on Intel Mac
23+
failingJsNativeApiTests.push("test_reference_by_node_api_version/test.js", "test_reference/test.js");
24+
}
25+
2026
// These are the tests from node-api that failed as of commit 83f536f4d, except for those that
2127
// passed in Bun v1.1.34. It'll take some time to get all these to work, as we've been focusing more
2228
// on js-native-api tests so far, and we don't want these tests to pollute CI. But we do want to
@@ -94,7 +100,9 @@ beforeAll(async () => {
94100
await child.exited;
95101
if (child.exitCode !== 0) {
96102
const stderr = await new Response(child.stderr).text();
97-
throw new Error(`node-gyp rebuild in ${dir} failed:\n${stderr}`);
103+
console.error(`node-gyp rebuild in ${dir} failed:\n${stderr}`);
104+
console.error("bailing out!");
105+
process.exit(1);
98106
}
99107
}
100108

@@ -106,7 +114,7 @@ beforeAll(async () => {
106114
}
107115

108116
const parallelism = Math.min(8, os.cpus().length, 1 /* TODO(@heimskr): remove */);
109-
const jobs = [];
117+
const jobs: Promise<void>[] = [];
110118
for (let i = 0; i < parallelism; i++) {
111119
jobs.push(worker());
112120
}

0 commit comments

Comments
 (0)