Skip to content

Commit

Permalink
Add proper timeouts to CI/nextest (gfx-rs#5051)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwfitzgerald authored Jan 13, 2024
1 parent 376d901 commit 5fd7d22
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# None of our tests should take longer than 45s, and if they've gone 2x that,
# terminate them to prevent infinite run-on.
[profile.default]
slow-timeout = { period = "45s", terminate-after = 2 }

# Use two threads for tests with "2_threads" in their name
[[profile.default.overrides]]
filter = 'test(~2_threads)'
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ env:
PKG_CONFIG_ALLOW_CROSS: 1 # allow android to work
RUSTFLAGS: --cfg=web_sys_unstable_apis -D warnings
RUSTDOCFLAGS: -Dwarnings
WASM_BINDGEN_TEST_TIMEOUT: 300 # 5 minutes
CACHE_SUFFIX: c # cache busting

# We distinguish the following kinds of builds:
Expand All @@ -74,6 +75,9 @@ env:

jobs:
check:
# runtime is normally 2-8 minutes
timeout-minutes: 15

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -230,6 +234,9 @@ jobs:
#
# We don't test all platforms, just ones with different dependency stacks.
check-core-msrv:
# runtime is normally 1-3 minutes
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -285,6 +292,9 @@ jobs:
cargo check --target ${{ matrix.target }} --all-features -p wgpu-core
naga-minimal-versions:
# runtime is normally 2 minutes
timeout-minutes: 10

name: MSRV naga Minimal Versions
runs-on: ubuntu-22.04

Expand Down Expand Up @@ -332,6 +342,9 @@ jobs:
cargo clippy --all-features -p naga -p naga-cli
wasm-test:
# runtime is normally 2 minutes
timeout-minutes: 10

name: Test WebAssembly
runs-on: ubuntu-latest
needs: [check]
Expand All @@ -357,6 +370,9 @@ jobs:
wasm-pack test --headless --chrome --features webgl --workspace
gpu-test:
# runtime is normally 5-15 minutes
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -541,6 +557,9 @@ jobs:
files: lcov.info

doctest:
# runtime is normally 2 minutes
timeout-minutes: 10

name: Doctest
runs-on: ubuntu-latest

Expand Down Expand Up @@ -576,6 +595,9 @@ jobs:
cargo test --doc
fmt:
# runtime is normally 15 seconds
timeout-minutes: 2

name: Format
runs-on: ubuntu-latest
steps:
Expand All @@ -594,6 +616,9 @@ jobs:
cargo fmt --manifest-path xtask/Cargo.toml -- --check
check-cts-runner:
# runtime is normally 2 minutes
timeout-minutes: 10

name: Clippy cts_runner
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -628,6 +653,9 @@ jobs:
#
# This job is not required to pass for PRs to be merged.
cargo-deny-check-advisories:
# runtime is normally 1 minute
timeout-minutes: 5

name: "cargo-deny advisories"
runs-on: ubuntu-latest
steps:
Expand All @@ -642,6 +670,9 @@ jobs:
rust-version: ${{ env.REPO_MSRV }}

cargo-deny-check-rest:
# runtime is normally 1 minute
timeout-minutes: 5

name: "cargo-deny"
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 5fd7d22

Please sign in to comment.