diff --git a/.github/workflows/nfs-lock.yml b/.github/workflows/nfs-lock.yml index 989c4f1743..98b87eae7e 100644 --- a/.github/workflows/nfs-lock.yml +++ b/.github/workflows/nfs-lock.yml @@ -6,10 +6,22 @@ name: NFS/Docker lock tests (nightly) # reach how `std::fs::File::try_lock` behaves on a network filesystem or in # real containers. See #324. +# Schedules use the default branch workflow; keep both branch copies identical. +# At #937, remap the schedules to main/v2.x and update TEST_REF/run-name. +run-name: NFS/Docker lock tests (${{ github.event_name == 'workflow_dispatch' && inputs.ref || (github.event.schedule == '17 21 * * *' && 'v3' || 'main') }}) + on: schedule: - - cron: "41 2 * * *" + # After the weekly corpus slots at 08:00/20:00 UTC. + - cron: "17 9 * * *" # main + - cron: "17 21 * * *" # v3 workflow_dispatch: + inputs: + ref: + description: Branch, tag or SHA to test + type: string + required: true + default: main permissions: contents: read @@ -19,6 +31,7 @@ permissions: # location cannot identify the examples directory. Keep the build destination # and the lock suites' helper override in sync (#887). env: + TEST_REF: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || (github.event.schedule == '17 21 * * *' && 'v3' || 'main') }} CARGO_TARGET_DIR: ${{ github.workspace }}/target MINIGRAF_PID_NS_HELPER: ${{ github.workspace }}/target/debug/examples/pid_ns_helper @@ -30,6 +43,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + ref: ${{ env.TEST_REF }} - name: Install Rust stable uses: dtolnay/rust-toolchain@stable @@ -83,14 +98,19 @@ jobs: echo "The nightly NFS lock suite failed." echo echo "- Run: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" - echo "- Commit: $GITHUB_SHA" + echo "- Ref: $TEST_REF" + echo "- Commit: $(git rev-parse HEAD 2>/dev/null || echo unavailable)" echo "- Reproduce: needs a loopback NFS export mounted as vers=4; see" echo " the \"nfs\" job in .github/workflows/nfs-lock.yml" echo echo "## Test output" echo echo '```text' - tail -n 1000 nfs-lock-output.txt + if [ -f nfs-lock-output.txt ]; then + tail -n 1000 nfs-lock-output.txt + else + echo "No test output was captured." + fi echo '```' } > "$report_file" @@ -116,6 +136,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + ref: ${{ env.TEST_REF }} - name: Install Rust stable uses: dtolnay/rust-toolchain@stable @@ -143,14 +165,19 @@ jobs: echo "The nightly Docker lock suite failed." echo echo "- Run: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" - echo "- Commit: $GITHUB_SHA" + echo "- Ref: $TEST_REF" + echo "- Commit: $(git rev-parse HEAD 2>/dev/null || echo unavailable)" echo "- Reproduce: needs a reachable Docker daemon; see the \"docker\" job" echo " in .github/workflows/nfs-lock.yml" echo echo "## Test output" echo echo '```text' - tail -n 1000 docker-lock-output.txt + if [ -f docker-lock-output.txt ]; then + tail -n 1000 docker-lock-output.txt + else + echo "No test output was captured." + fi echo '```' } > "$report_file" diff --git a/.github/workflows/property-tests.yml b/.github/workflows/property-tests.yml index fdd948138f..b6d313a990 100644 --- a/.github/workflows/property-tests.yml +++ b/.github/workflows/property-tests.yml @@ -1,37 +1,66 @@ name: Property Tests (nightly) +# Schedules use the default branch workflow; keep both branch copies identical. +# At #937, remap the schedules to main/v2.x and update TEST_REF/run-name. +run-name: Property Tests (${{ github.event_name == 'workflow_dispatch' && inputs.ref || (github.event.schedule == '23 22 * * *' && 'v3' || 'main') }}) + on: schedule: - # Offset from the 02:00 UTC benchmark schedule to avoid runner contention. - - cron: "23 2 * * *" + # After the NFS slots, away from benchmark/fuzz starts. + - cron: "23 10 * * *" # main + - cron: "23 22 * * *" # v3 workflow_dispatch: + inputs: + ref: + description: Branch, tag or SHA to test + type: string + required: true + default: main permissions: contents: read issues: write +env: + TEST_REF: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || (github.event.schedule == '23 22 * * *' && 'v3' || 'main') }} + jobs: proptest: - name: Property tests + name: Property tests (${{ matrix.test }}) runs-on: ubuntu-latest timeout-minutes: 360 + strategy: + fail-fast: false + matrix: + include: + # Query properties (#386): 1M in-memory cases (~3 ms each) and a + # tenth as many file-backed ones (~57 ms each, checkpoint and + # reopen), plus 1M of each one-pattern property; ~1.6 h locally. + - test: property_test + cases: 1000000 + # Model-based storage test (#385): each case runs up to 50 steps + # against a file, ~0.1 s per case. + - test: model_based_test + cases: 30000 steps: - uses: actions/checkout@v4 + with: + ref: ${{ env.TEST_REF }} + # Detect the optional suite in the checkout, including tags and candidate SHAs. - name: Install Rust stable + if: ${{ matrix.test != 'model_based_test' || hashFiles('tests/model_based_test.rs') != '' }} uses: dtolnay/rust-toolchain@stable - name: Run property tests + if: ${{ matrix.test != 'model_based_test' || hashFiles('tests/model_based_test.rs') != '' }} shell: bash run: | set -o pipefail - cargo test --test property_test -- --nocapture 2>&1 | tee proptest-output.txt + cargo test --test ${{ matrix.test }} -- --nocapture 2>&1 | tee proptest-output.txt env: - # Query properties (#386): 1M in-memory cases (~3 ms each) and a - # tenth as many file-backed ones (~57 ms each, checkpoint and - # reopen), plus 1M of each one-pattern property; ~1.6 h locally. - PROPTEST_CASES: 1000000 + PROPTEST_CASES: ${{ matrix.cases }} RUST_BACKTRACE: 1 - name: Record property-test failure @@ -40,19 +69,26 @@ jobs: env: GH_TOKEN: ${{ github.token }} ISSUE_TITLE: "Nightly property-test failure" + TEST_NAME: ${{ matrix.test }} + CASES: ${{ matrix.cases }} run: | report_file="property-test-failure.md" { - echo "The nightly property-test workflow failed." + echo "The nightly property-test workflow failed in \`$TEST_NAME\`." echo echo "- Run: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" - echo "- Commit: $GITHUB_SHA" - echo "- Reproduce: \`PROPTEST_CASES=1000000 cargo test --test property_test -- --nocapture\`" + echo "- Ref: $TEST_REF" + echo "- Commit: $(git rev-parse HEAD 2>/dev/null || echo unavailable)" + echo "- Reproduce: \`PROPTEST_CASES=$CASES cargo test --test $TEST_NAME -- --nocapture\`" echo echo "## Test output" echo echo '```text' - tail -n 1000 proptest-output.txt + if [ -f proptest-output.txt ]; then + tail -n 1000 proptest-output.txt + else + echo "No test output was captured." + fi echo '```' } > "$report_file"