Skip to content

Commit

Permalink
Split miri into two parts, run slow only in nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
def- committed Jul 13, 2023
1 parent c019367 commit 8f7dcec
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 6 deletions.
13 changes: 13 additions & 0 deletions ci/nightly/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ steps:
- select: Tests
key: tests
options:
- { value: miri-test }
- { value: kafka-matrix }
- { value: kafka-multi-broker }
- { value: redpanda-testdrive }
Expand Down Expand Up @@ -92,6 +93,18 @@ steps:

- wait: ~

- id: miri-test
label: Miri test (full)
timeout_in_minutes: 600
artifact_paths: [junit_*.xml, target/nextest/ci/junit_cargo-test.xml]
plugins:
- ./ci/plugins/scratch-aws-access: ~
- ./ci/plugins/mzcompose:
composition: cargo-test
args: [--miri-full]
agents:
queue: builder-linux-x86_64

- id: feature-benchmark
label: "Feature benchmark against 'latest'"
timeout_in_minutes: 360
Expand Down
26 changes: 26 additions & 0 deletions ci/test/cargo-test-miri-fast.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0.
#
# cargo-test-miri.sh — runs subset of unit tests under miri to check for
# undefined behaviour.

set -euo pipefail

# miri artifacts are thoroughly incompatible with normal build artifacts,
# so keep them away from the `target` directory.
export CARGO_TARGET_DIR="$PWD/miri-target"
export MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-strict-provenance"

PARTITION=$((${BUILDKITE_PARALLEL_JOB:-0}+1))
TOTAL=${BUILDKITE_PARALLEL_JOB_COUNT:-1}

# exclude network-based and more complex tests which run out of memory
cargo miri nextest run -j"$(nproc)" --partition "count:$PARTITION/$TOTAL" --no-fail-fast --workspace --exclude 'mz-adapter*' --exclude 'mz-environmentd*' --exclude 'mz-expr*' --exclude 'mz-compute-client*' --exclude 'mz-persist-client*' --exclude 'mz-ssh-util*' --exclude 'mz-rocksdb*' --exclude 'mz-sqllogictest*'
10 changes: 8 additions & 2 deletions ci/test/cargo-test/mzcompose.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@


def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
parser.add_argument("--miri", action="store_true")
parser.add_argument("--miri-full", action="store_true")
parser.add_argument("--miri-fast", action="store_true")
parser.add_argument("args", nargs="*")
args = parser.parse_args()
c.up("zookeeper", "kafka", "schema-registry", "postgres", "cockroach")
Expand Down Expand Up @@ -108,11 +109,16 @@ def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
["buildkite-agent", "artifact", "upload", "coverage/cargotest.lcov.xz"]
)
else:
if args.miri:
if args.miri_full:
spawn.runv(
["bin/ci-builder", "run", "nightly", "ci/test/cargo-test-miri.sh"],
env=env,
)
elif args.miri_fast:
spawn.runv(
["bin/ci-builder", "run", "nightly", "ci/test/cargo-test-miri-fast.sh"],
env=env,
)
else:
spawn.runv(
[
Expand Down
7 changes: 3 additions & 4 deletions ci/test/pipeline.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,16 @@ steps:
queue: builder-linux-x86_64

- id: miri-test
label: Miri test %n
command: bin/ci-builder run nightly ci/test/cargo-test-miri.sh
label: Miri test (fast) %n
inputs: [src]
parallelism: 6
parallelism: 2
timeout_in_minutes: 30
artifact_paths: [junit_*.xml, target/nextest/ci/junit_cargo-test.xml]
plugins:
- ./ci/plugins/scratch-aws-access: ~
- ./ci/plugins/mzcompose:
composition: cargo-test
args: [--miri]
args: [--miri-fast]
agents:
queue: builder-linux-x86_64
coverage: skip
Expand Down

0 comments on commit 8f7dcec

Please sign in to comment.