diff --git a/tests/lib/cli-engine/cli-engine.js b/tests/lib/cli-engine/cli-engine.js index b215b0d315b..b4d65fa1163 100644 --- a/tests/lib/cli-engine/cli-engine.js +++ b/tests/lib/cli-engine/cli-engine.js @@ -102,7 +102,15 @@ describe("CLIEngine", () => { } // copy into clean area so as not to get "infected" by this project's .eslintrc files - before(() => { + before(function() { + + /* + * GitHub Actions Windows and macOS runners occasionally exhibit + * extremely slow filesystem operations, during which copying fixtures + * exceeds the default test timeout, so raise it just for this hook. + * Mocha uses `this` to set timeouts on an individual hook level. + */ + this.timeout(60 * 1000); // eslint-disable-line no-invalid-this shell.mkdir("-p", fixtureDir); shell.cp("-r", "./tests/fixtures/.", fixtureDir); }); diff --git a/tests/lib/cli-engine/file-enumerator.js b/tests/lib/cli-engine/file-enumerator.js index 43728862d95..7f91b2a95f4 100644 --- a/tests/lib/cli-engine/file-enumerator.js +++ b/tests/lib/cli-engine/file-enumerator.js @@ -211,7 +211,16 @@ describe("FileEnumerator", () => { ); } - before(() => { + before(function() { + + /* + * GitHub Actions Windows and macOS runners occasionally + * exhibit extremely slow filesystem operations, during which + * copying fixtures exceeds the default test timeout, so raise + * it just for this hook. Mocha uses `this` to set timeouts on + * an individual hook level. + */ + this.timeout(60 * 1000); // eslint-disable-line no-invalid-this fixtureDir = `${os.tmpdir()}/eslint/tests/fixtures/`; sh.mkdir("-p", fixtureDir); sh.cp("-r", "./tests/fixtures/*", fixtureDir); diff --git a/tests/lib/cli.js b/tests/lib/cli.js index a1d9a23e491..0f8a24c2e28 100644 --- a/tests/lib/cli.js +++ b/tests/lib/cli.js @@ -82,7 +82,15 @@ describe("cli", () => { } // copy into clean area so as not to get "infected" by this project's .eslintrc files - before(() => { + before(function() { + + /* + * GitHub Actions Windows and macOS runners occasionally exhibit + * extremely slow filesystem operations, during which copying fixtures + * exceeds the default test timeout, so raise it just for this hook. + * Mocha uses `this` to set timeouts on an individual hook level. + */ + this.timeout(60 * 1000); // eslint-disable-line no-invalid-this fixtureDir = `${os.tmpdir()}/eslint/fixtures`; sh.mkdir("-p", fixtureDir); sh.cp("-r", "./tests/fixtures/.", fixtureDir); diff --git a/tests/lib/eslint/eslint.js b/tests/lib/eslint/eslint.js index dbb0059286c..d6abf5a8bda 100644 --- a/tests/lib/eslint/eslint.js +++ b/tests/lib/eslint/eslint.js @@ -86,7 +86,15 @@ describe("ESLint", () => { } // copy into clean area so as not to get "infected" by this project's .eslintrc files - before(() => { + before(function() { + + /* + * GitHub Actions Windows and macOS runners occasionally exhibit + * extremely slow filesystem operations, during which copying fixtures + * exceeds the default test timeout, so raise it just for this hook. + * Mocha uses `this` to set timeouts on an individual hook level. + */ + this.timeout(60 * 1000); // eslint-disable-line no-invalid-this shell.mkdir("-p", fixtureDir); shell.cp("-r", "./tests/fixtures/.", fixtureDir); });