From fc0238f61316c0cf2ed7a3fae630184e5da47c9c Mon Sep 17 00:00:00 2001 From: Justin Kovacich Date: Tue, 20 Oct 2026 16:19:01 -0400 Subject: [PATCH] ci: run the Miri connection tests one target per runner Miri interprets on a single thread, so the connection tests ran end to end on one runner for 24 minutes, most of it the cancellation sweeps in entity_cancel and tester. Each target now runs on its own runner, and a gate job keeps the check name main's ruleset requires. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 39 ++++++++++++++++++++++++++++++++++----- justfile | 2 +- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd94ab07..1232c0a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -238,11 +238,25 @@ jobs: # sockets (entity_std, entity_interop, tester_late_ack) cannot be. # Tree borrows, because stacked borrows rejects embassy-futures' select_array, which # tree borrows accepts. See `just miri`. - miri-connection: - name: Miri (simple_doip connection) + # Miri interprets on one thread, so each test target runs on its own runner. The + # cancellation sweeps in entity_cancel and tester take minutes each under Miri. + miri-connection-target: + name: Miri (simple_doip connection, ${{ matrix.name }}) runs-on: ubuntu-latest permissions: contents: read + strategy: + fail-fast: false + matrix: + include: + - name: lib and mock_stack + targets: --lib --test mock_stack + - name: entity + targets: --test entity + - name: entity_cancel + targets: --test entity_cancel + - name: tester + targets: --test tester steps: - uses: actions/checkout@v7 with: @@ -252,12 +266,27 @@ jobs: toolchain: nightly components: miri - uses: Swatinem/rust-cache@v2 + with: + key: ${{ matrix.name }} - name: Run the connection tests under Miri env: MIRIFLAGS: -Zmiri-tree-borrows - run: >- - cargo miri test -p simple_doip --features connection - --lib --test tester --test entity --test entity_cancel --test mock_stack + TARGETS: ${{ matrix.targets }} + # Unquoted: TARGETS holds several cargo arguments. + run: cargo miri test -p simple_doip --features connection $TARGETS + + # The check main's ruleset requires: green only when every target above passed. + miri-connection: + name: Miri (simple_doip connection) + if: always() + needs: miri-connection-target + runs-on: ubuntu-latest + permissions: {} + steps: + - name: Every target passed + env: + RESULT: ${{ needs.miri-connection-target.result }} + run: test "$RESULT" = success # =================================================================================== # Loopback (hand-rolled: the reusable workflow tests default members only) diff --git a/justfile b/justfile index 099ce318..30f6cd33 100644 --- a/justfile +++ b/justfile @@ -180,7 +180,7 @@ size-baseline: (size "--record") # emulate. Linux's `epoll` it does. # # Then simple_doip's `connection` tests on the mock stack, which default features leave -# out, as ci.yml's `miri-connection` job runs them. +# out, as ci.yml's `miri-connection-target` jobs run them. [doc("Run the test suite under Miri, as CI does")] miri: rustup toolchain install nightly --component miri --profile minimal --no-self-update