Skip to content

Commit f293e3e

Browse files
committed
test(napi/parser): disable raw transfer tests on antd.js fixture (#14446)
The raw transfer test on `antd.js` fixture is timing out sometimes on CI. We already disabled the "range & parent" test on this fixture. Disable the other test on it too. But only skip these tests in CI. (alternative to #14438)
1 parent c3cdf07 commit f293e3e

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

napi/parser/test/parse-raw.test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Tests for raw transfer.
22

33
import { mkdir, readdir, readFile, stat, writeFile } from 'node:fs/promises';
4-
import { basename, join as pathJoin, sep as pathSep } from 'node:path';
4+
import { basename, join as pathJoin } from 'node:path';
55
import Tinypool from 'tinypool';
66
import { describe, expect, it } from 'vitest';
77

@@ -64,7 +64,7 @@ async function runCaseInWorker(type, props) {
6464

6565
// Download fixtures.
6666
// Save in `target` directory, same as where benchmarks store them.
67-
const benchFixtureUrls = [
67+
let benchFixtureUrls = [
6868
// TypeScript syntax (2.81MB)
6969
'https://cdn.jsdelivr.net/gh/microsoft/TypeScript@v5.3.3/src/compiler/checker.ts',
7070
// Real world app tsx (1.0M)
@@ -77,6 +77,11 @@ const benchFixtureUrls = [
7777
'https://cdn.jsdelivr.net/npm/antd@4.16.1/dist/antd.js',
7878
];
7979

80+
// `antd.js` tests sometimes take longer than 5 secs on CI, so skip that fixture in CI.
81+
// Tried setting `{ timeout: 10_000 }` option, but it didn't work for some reason.
82+
// TODO: Get longer timeout working and re-enable these tests in CI.
83+
if (process.env.CI) benchFixtureUrls = benchFixtureUrls.filter(url => !url.endsWith('/antd.js'));
84+
8085
await mkdir(TARGET_DIR_PATH, { recursive: true });
8186

8287
const benchFixturePaths = await Promise.all(benchFixtureUrls.map(async (url) => {
@@ -225,12 +230,9 @@ describe.concurrent('fixtures', () => {
225230
it.each(benchFixturePaths)('%s', path => runCaseInWorker(TEST_TYPE_FIXTURE, path));
226231
});
227232

228-
// `antd.js` test sometimes takes longer than 5 seconds on CI, so skip it.
229-
// TODO: Why doesn't `timeout` option work?
230-
describeRangeParent.concurrent('range & parent fixtures', { timeout: 10_000 }, () => {
231-
const paths = benchFixturePaths.filter(path => !path.endsWith(`${pathSep}antd.js`));
233+
describeRangeParent.concurrent('range & parent fixtures', () => {
232234
// oxlint-disable-next-line jest/expect-expect
233-
it.each(paths)('%s', path => runCaseInWorker(TEST_TYPE_FIXTURE | TEST_TYPE_RANGE_PARENT, path));
235+
it.each(benchFixturePaths)('%s', path => runCaseInWorker(TEST_TYPE_FIXTURE | TEST_TYPE_RANGE_PARENT, path));
234236
});
235237

236238
// Check lazy deserialization doesn't throw

0 commit comments

Comments
 (0)