From 9423da7f3d7e7621fb0d02ece561492266a145d5 Mon Sep 17 00:00:00 2001 From: Brooke Hamilton <45323234+brooke-hamilton@users.noreply.github.com> Date: Wed, 8 Apr 2026 18:46:53 -0400 Subject: [PATCH] update test timeouts Signed-off-by: Brooke Hamilton <45323234+brooke-hamilton@users.noreply.github.com> --- .github/workflows/dev-containers.yml | 4 + .github/workflows/test-docker-v20.yml | 1 + .github/workflows/test-docker-v29.yml | 1 + .github/workflows/test-windows.yml | 1 + .mocharc.yml | 1 + package.json | 210 +++++++++++++------------- 6 files changed, 113 insertions(+), 105 deletions(-) create mode 100644 .mocharc.yml diff --git a/.github/workflows/dev-containers.yml b/.github/workflows/dev-containers.yml index c9b490854..930d77d31 100644 --- a/.github/workflows/dev-containers.yml +++ b/.github/workflows/dev-containers.yml @@ -16,6 +16,7 @@ jobs: cli: name: CLI runs-on: ubuntu-latest + timeout-minutes: 10 steps: - uses: actions/checkout@v6 - uses: actions/setup-node@v5 @@ -44,6 +45,7 @@ jobs: tests-matrix: name: Tests Matrix runs-on: ubuntu-latest + timeout-minutes: 30 strategy: fail-fast: false matrix: @@ -111,6 +113,7 @@ jobs: # TODO: This should be expanded to run on different platforms # Most notably to test platform-specific credential helper behavior runs-on: ubuntu-latest + timeout-minutes: 10 steps: - name: Checkout uses: actions/checkout@v6 @@ -145,6 +148,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} + timeout-minutes: 10 steps: - uses: actions/checkout@v6 - name: Run install.sh tests diff --git a/.github/workflows/test-docker-v20.yml b/.github/workflows/test-docker-v20.yml index 0b35c363b..69f8d3569 100644 --- a/.github/workflows/test-docker-v20.yml +++ b/.github/workflows/test-docker-v20.yml @@ -13,6 +13,7 @@ jobs: test-docker-v20: name: Docker v20.10 Compatibility runs-on: ubuntu-22.04 + timeout-minutes: 20 steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/test-docker-v29.yml b/.github/workflows/test-docker-v29.yml index e3db37304..de475f246 100644 --- a/.github/workflows/test-docker-v29.yml +++ b/.github/workflows/test-docker-v29.yml @@ -13,6 +13,7 @@ jobs: test-docker-v29: name: Docker v29.0.0 Compatibility runs-on: ubuntu-latest + timeout-minutes: 20 steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 3f4d323f2..5ac9743d1 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -19,6 +19,7 @@ jobs: tests-matrix: name: Tests Matrix (Windows) runs-on: windows-latest + timeout-minutes: 15 strategy: fail-fast: false matrix: diff --git a/.mocharc.yml b/.mocharc.yml new file mode 100644 index 000000000..42bdad050 --- /dev/null +++ b/.mocharc.yml @@ -0,0 +1 @@ +timeout: 360000 # 6 minutes global safety net; individual suites override via this.timeout() diff --git a/package.json b/package.json index e783c0d12..faed63524 100644 --- a/package.json +++ b/package.json @@ -1,106 +1,106 @@ { - "name": "@devcontainers/cli", - "description": "Dev Containers CLI", - "version": "0.85.0", - "bin": { - "devcontainer": "devcontainer.js" - }, - "author": "Microsoft Corporation", - "repository": { - "type": "git", - "url": "https://github.com/devcontainers/cli.git" - }, - "bugs": { - "url": "https://github.com/devcontainers/cli/issues" - }, - "license": "MIT", - "engines": { - "node": ">=20.0.0" - }, - "scripts": { - "compile": "npm-run-all clean-dist compile-dev", - "watch": "npm-run-all clean-dist compile-watch", - "package": "npm-run-all clean-dist compile-prod store-packagejson patch-packagejson npm-pack restore-packagejson", - "store-packagejson": "copyfiles package.json build-tmp/", - "patch-packagejson": "node build/patch-packagejson.js", - "restore-packagejson": "copyfiles --up 1 build-tmp/package.json .", - "type-check": "npm-run-all clean-built tsc-b", - "type-check-watch": "npm-run-all clean-built tsc-b-w", - "compile-prod": "node esbuild.js --production", - "compile-dev": "node esbuild.js", - "compile-watch": "node esbuild.js --watch", - "tsc-b": "tsc -b", - "tsc-b-w": "tsc -b -w", - "precommit": "node build/hygiene.js", - "lint": "eslint --max-warnings 0 ./src", - "npm-pack": "npm pack", - "clean": "npm-run-all clean-dist clean-built", - "clean-dist": "rimraf dist", - "clean-built": "rimraf built", - "test": "env TS_NODE_PROJECT=src/test/tsconfig.json mocha -r ts-node/register --exit src/test/*.test.ts", - "test-matrix": "env TS_NODE_PROJECT=src/test/tsconfig.json mocha -r ts-node/register --exit", - "test-container-features": "env TS_NODE_PROJECT=src/test/tsconfig.json mocha -r ts-node/register --exit src/test/container-features/*.test.ts", - "test-container-features-cli": "env TS_NODE_PROJECT=src/test/tsconfig.json mocha -r ts-node/register --exit src/test/container-features/featuresCLICommands.test.ts", - "test-container-templates": "env TS_NODE_PROJECT=src/test/tsconfig.json mocha -r ts-node/register --exit src/test/container-templates/*.test.ts" - }, - "files": [ - "CHANGELOG.md", - "LICENSE.txt", - "README.md", - "ThirdPartyNotices.txt", - "devcontainer.js", - "dist/spec-node/devContainersSpecCLI.js", - "package.json", - "scripts/updateUID.Dockerfile" - ], - "devDependencies": { - "@stylistic/eslint-plugin": "^5.10.0", - "@types/chai": "^4.3.20", - "@types/follow-redirects": "^1.14.4", - "@types/js-yaml": "^4.0.9", - "@types/mocha": "^10.0.10", - "@types/ncp": "^2.0.8", - "@types/node": "^20.19.37", - "@types/pull-stream": "^3.6.7", - "@types/recursive-readdir": "^2.2.4", - "@types/semver": "^7.7.1", - "@types/shell-quote": "^1.7.5", - "@types/text-table": "^0.2.5", - "@types/yargs": "^17.0.35", - "@typescript-eslint/eslint-plugin": "^8.56.1", - "@typescript-eslint/parser": "^8.56.1", - "chai": "^4.5.0", - "copyfiles": "^2.4.1", - "esbuild": "^0.27.3", - "eslint": "^10.0.2", - "event-stream": "^4.0.1", - "minimatch": "^10.2.4", - "mocha": "^11.7.5", - "npm-run-all": "^4.1.5", - "p-all": "^5.0.1", - "rimraf": "^6.1.3", - "ts-node": "^10.9.2", - "typescript": "^5.9.3", - "typescript-formatter": "^7.2.2", - "vinyl": "^3.0.1", - "vinyl-fs": "^4.0.2" - }, - "dependencies": { - "chalk": "^5.6.2", - "follow-redirects": "^1.15.11", - "js-yaml": "^4.1.1", - "jsonc-parser": "^3.3.1", - "ncp": "^2.0.0", - "node-pty": "~1.0.0", - "proxy-agent": "^6.5.0", - "pull-stream": "^3.7.0", - "recursive-readdir": "^2.2.3", - "semver": "^7.7.4", - "shell-quote": "^1.8.3", - "stream-to-pull-stream": "^1.7.3", - "tar": "^7.5.10", - "text-table": "^0.2.0", - "vscode-uri": "^3.1.0", - "yargs": "~17.7.2" - } -} + "name": "@devcontainers/cli", + "description": "Dev Containers CLI", + "version": "0.85.0", + "bin": { + "devcontainer": "devcontainer.js" + }, + "author": "Microsoft Corporation", + "repository": { + "type": "git", + "url": "https://github.com/devcontainers/cli.git" + }, + "bugs": { + "url": "https://github.com/devcontainers/cli/issues" + }, + "license": "MIT", + "engines": { + "node": ">=20.0.0" + }, + "scripts": { + "compile": "npm-run-all clean-dist compile-dev", + "watch": "npm-run-all clean-dist compile-watch", + "package": "npm-run-all clean-dist compile-prod store-packagejson patch-packagejson npm-pack restore-packagejson", + "store-packagejson": "copyfiles package.json build-tmp/", + "patch-packagejson": "node build/patch-packagejson.js", + "restore-packagejson": "copyfiles --up 1 build-tmp/package.json .", + "type-check": "npm-run-all clean-built tsc-b", + "type-check-watch": "npm-run-all clean-built tsc-b-w", + "compile-prod": "node esbuild.js --production", + "compile-dev": "node esbuild.js", + "compile-watch": "node esbuild.js --watch", + "tsc-b": "tsc -b", + "tsc-b-w": "tsc -b -w", + "precommit": "node build/hygiene.js", + "lint": "eslint --max-warnings 0 ./src", + "npm-pack": "npm pack", + "clean": "npm-run-all clean-dist clean-built", + "clean-dist": "rimraf dist", + "clean-built": "rimraf built", + "test": "env TS_NODE_PROJECT=src/test/tsconfig.json mocha -r ts-node/register --exit src/test/*.test.ts", + "test-matrix": "env TS_NODE_PROJECT=src/test/tsconfig.json mocha -r ts-node/register --exit --retries 1", + "test-container-features": "env TS_NODE_PROJECT=src/test/tsconfig.json mocha -r ts-node/register --exit src/test/container-features/*.test.ts", + "test-container-features-cli": "env TS_NODE_PROJECT=src/test/tsconfig.json mocha -r ts-node/register --exit src/test/container-features/featuresCLICommands.test.ts", + "test-container-templates": "env TS_NODE_PROJECT=src/test/tsconfig.json mocha -r ts-node/register --exit src/test/container-templates/*.test.ts" + }, + "files": [ + "CHANGELOG.md", + "LICENSE.txt", + "README.md", + "ThirdPartyNotices.txt", + "devcontainer.js", + "dist/spec-node/devContainersSpecCLI.js", + "package.json", + "scripts/updateUID.Dockerfile" + ], + "devDependencies": { + "@stylistic/eslint-plugin": "^5.10.0", + "@types/chai": "^4.3.20", + "@types/follow-redirects": "^1.14.4", + "@types/js-yaml": "^4.0.9", + "@types/mocha": "^10.0.10", + "@types/ncp": "^2.0.8", + "@types/node": "^20.19.37", + "@types/pull-stream": "^3.6.7", + "@types/recursive-readdir": "^2.2.4", + "@types/semver": "^7.7.1", + "@types/shell-quote": "^1.7.5", + "@types/text-table": "^0.2.5", + "@types/yargs": "^17.0.35", + "@typescript-eslint/eslint-plugin": "^8.56.1", + "@typescript-eslint/parser": "^8.56.1", + "chai": "^4.5.0", + "copyfiles": "^2.4.1", + "esbuild": "^0.27.3", + "eslint": "^10.0.2", + "event-stream": "^4.0.1", + "minimatch": "^10.2.4", + "mocha": "^11.7.5", + "npm-run-all": "^4.1.5", + "p-all": "^5.0.1", + "rimraf": "^6.1.3", + "ts-node": "^10.9.2", + "typescript": "^5.9.3", + "typescript-formatter": "^7.2.2", + "vinyl": "^3.0.1", + "vinyl-fs": "^4.0.2" + }, + "dependencies": { + "chalk": "^5.6.2", + "follow-redirects": "^1.15.11", + "js-yaml": "^4.1.1", + "jsonc-parser": "^3.3.1", + "ncp": "^2.0.0", + "node-pty": "~1.0.0", + "proxy-agent": "^6.5.0", + "pull-stream": "^3.7.0", + "recursive-readdir": "^2.2.3", + "semver": "^7.7.4", + "shell-quote": "^1.8.3", + "stream-to-pull-stream": "^1.7.3", + "tar": "^7.5.10", + "text-table": "^0.2.0", + "vscode-uri": "^3.1.0", + "yargs": "~17.7.2" + } +} \ No newline at end of file