From d9c191d270f64f4694c54f9d9aba3178cbc6295a Mon Sep 17 00:00:00 2001 From: LongYinan Date: Sun, 16 Apr 2023 23:59:15 +0800 Subject: [PATCH] test(napi): skip worker tests in slow Docker env (#1569) --- examples/napi/__tests__/worker-thread.spec.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/napi/__tests__/worker-thread.spec.ts b/examples/napi/__tests__/worker-thread.spec.ts index 1276eb5e..2a198da1 100644 --- a/examples/napi/__tests__/worker-thread.spec.ts +++ b/examples/napi/__tests__/worker-thread.spec.ts @@ -5,7 +5,11 @@ import test from 'ava' import { Animal, Kind, DEFAULT_COST } from '../index' -test('should be able to require in worker thread', async (t) => { +// aarch64-unknown-linux-gnu is extremely slow in CI, skip it or it will timeout +const t = + process.arch === 'arm64' && process.platform === 'linux' ? test.skip : test + +t('should be able to require in worker thread', async (t) => { await Promise.all( Array.from({ length: 100 }).map(() => { const w = new Worker(join(__dirname, 'worker.js')) @@ -27,7 +31,7 @@ test('should be able to require in worker thread', async (t) => { ) }) -test('custom GC works on worker_threads', async (t) => { +t('custom GC works on worker_threads', async (t) => { await Promise.all( Array.from({ length: 50 }).map(() => Promise.all([ @@ -66,7 +70,7 @@ test('custom GC works on worker_threads', async (t) => { ) }) -test('should be able to new Class in worker thread concurrently', async (t) => { +t('should be able to new Class in worker thread concurrently', async (t) => { await Promise.all( Array.from({ length: 100 }).map(() => { const w = new Worker(join(__dirname, 'worker.js'))