Skip to content

Commit eee459c

Browse files
authored
chore: fix intermittent timeouts in osx test runners (#6007)
* chore: workflow steps are no longer relevant * fix: hoist build import to top of file * test: use serial only for macosx and only in github actions
1 parent 47b8fef commit eee459c

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

.github/workflows/workflow.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ jobs:
6060
deno-version: 'v1.46.3'
6161
fail-fast: false
6262
steps:
63-
# Increasing the maximum number of open files. See:
64-
# https://github.com/actions/virtual-environments/issues/268
65-
- name: Increase open file limit
66-
run: sudo ulimit -Sn 65536
67-
if: "${{ matrix.os == 'macos-14' }}"
68-
- run: git config --global core.symlinks true
6963
# Sets an output parameter if this is a release PR
7064
- name: Check for release
7165
id: release-check

packages/build/ava.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
import { platform } from 'node:os'
2+
import { env } from 'node:process'
3+
14
import baseConfig from '../../ava.base.js'
25

36
const config = {
47
...baseConfig,
58
files: ['tests/**/tests.{cjs,mjs,js}'],
9+
// github action runners for osx have lower memory than windows/linux
10+
// https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
11+
serial: env.GITHUB_ACTIONS && platform() === 'darwin',
612
}
713

814
export default config

packages/testing/src/fixture.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { normalize, delimiter } from 'path'
44
import { env } from 'process'
55
import { fileURLToPath } from 'url'
66

7+
import { default as build, startDev } from '@netlify/build'
78
import test from 'ava'
89
import cpy from 'cpy'
910
import { execa, execaCommand } from 'execa'
@@ -194,7 +195,6 @@ export class Fixture {
194195

195196
/** Runs @netlify/build main function programmatic with the provided flags */
196197
async runBuildProgrammatic(): Promise<object> {
197-
const { default: build } = await import('@netlify/build')
198198
return await build(this.getBuildFlags())
199199
}
200200

@@ -204,7 +204,6 @@ export class Fixture {
204204
}
205205

206206
async runWithBuildAndIntrospect() {
207-
const { default: build } = await import('@netlify/build')
208207
const buildResult = await build(this.getBuildFlags())
209208
const output = [buildResult.logs?.stdout.join('\n'), buildResult.logs?.stderr.join('\n')]
210209
.filter(Boolean)
@@ -218,7 +217,6 @@ export class Fixture {
218217

219218
// TODO: provide better typing if we know what's possible
220219
async runDev(devCommand: unknown): Promise<string> {
221-
const { startDev } = await import('@netlify/build')
222220
const entryPoint = startDev.bind(null, devCommand)
223221
const { logs } = await entryPoint(this.getBuildFlags())
224222
return [logs.stdout.join('\n'), logs.stderr.join('\n')].filter(Boolean).join('\n\n')

0 commit comments

Comments
 (0)