Nightly Property Tests #108
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Nightly Property Tests | |
| # Runs the jqwik-based concurrent budget-exhaustion property test against | |
| # a full reservation + Redis stack (Testcontainers). Excluded from PR CI | |
| # because a single run takes several minutes; nightly gives us deep | |
| # interleaving coverage without blocking PR feedback. | |
| # | |
| # Test: BudgetExhaustionConcurrentPropertyTest | |
| # Invariants asserted: | |
| # I1. sum(committed charged_amount) <= initial_budget under REJECT policy | |
| # I2. No reservation in two terminal states simultaneously | |
| # I3. Every reservation terminates within TTL + grace + sweep | |
| # | |
| # Failure triage: jqwik shrinks automatically. Surefire reports include | |
| # the minimal (budget, threads, workload) triple that violates an invariant. | |
| on: | |
| schedule: | |
| - cron: '0 6 * * *' # 06:00 UTC daily | |
| workflow_dispatch: {} # manual trigger | |
| permissions: read-all | |
| jobs: | |
| property-tests: | |
| name: Property-based concurrent invariants | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| cache: maven | |
| # Testcontainers boots redis:7-alpine via Docker (preinstalled on ubuntu-latest). | |
| # jqwik.tries.default=100 overrides the default of 20 from | |
| # junit-platform.properties to give | |
| # nightly 5x deeper interleaving coverage than a PR-feedback run. | |
| # Use `mvn test` (not `verify`) because -Pproperty-tests restricts | |
| # surefire to only the 5 property-tagged tests — running `verify` would | |
| # trigger JaCoCo's 95% coverage check on a test subset that exercises | |
| # almost no code paths, failing the build despite all property | |
| # invariants passing. PR CI still enforces the full-suite coverage | |
| # bar; this nightly is about invariant coverage over interleavings, | |
| # not code-path coverage. | |
| - name: Run property-based tests | |
| run: > | |
| mvn -B test | |
| --file cycles-protocol-service/pom.xml | |
| -Pproperty-tests | |
| -Djqwik.tries.default=100 | |
| -Dsurefire.failIfNoSpecifiedTests=false | |
| - name: Upload surefire reports on failure | |
| if: failure() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: surefire-reports-property-tests | |
| path: cycles-protocol-service/cycles-protocol-service-api/target/surefire-reports/ | |
| retention-days: 14 |