Skip to content

Commit 8f7dcec

Browse files
committed
Split miri into two parts, run slow only in nightly
1 parent c019367 commit 8f7dcec

File tree

4 files changed

+50
-6
lines changed

4 files changed

+50
-6
lines changed

ci/nightly/pipeline.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ steps:
1717
- select: Tests
1818
key: tests
1919
options:
20+
- { value: miri-test }
2021
- { value: kafka-matrix }
2122
- { value: kafka-multi-broker }
2223
- { value: redpanda-testdrive }
@@ -92,6 +93,18 @@ steps:
9293

9394
- wait: ~
9495

96+
- id: miri-test
97+
label: Miri test (full)
98+
timeout_in_minutes: 600
99+
artifact_paths: [junit_*.xml, target/nextest/ci/junit_cargo-test.xml]
100+
plugins:
101+
- ./ci/plugins/scratch-aws-access: ~
102+
- ./ci/plugins/mzcompose:
103+
composition: cargo-test
104+
args: [--miri-full]
105+
agents:
106+
queue: builder-linux-x86_64
107+
95108
- id: feature-benchmark
96109
label: "Feature benchmark against 'latest'"
97110
timeout_in_minutes: 360

ci/test/cargo-test-miri-fast.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright Materialize, Inc. and contributors. All rights reserved.
4+
#
5+
# Use of this software is governed by the Business Source License
6+
# included in the LICENSE file at the root of this repository.
7+
#
8+
# As of the Change Date specified in that file, in accordance with
9+
# the Business Source License, use of this software will be governed
10+
# by the Apache License, Version 2.0.
11+
#
12+
# cargo-test-miri.sh — runs subset of unit tests under miri to check for
13+
# undefined behaviour.
14+
15+
set -euo pipefail
16+
17+
# miri artifacts are thoroughly incompatible with normal build artifacts,
18+
# so keep them away from the `target` directory.
19+
export CARGO_TARGET_DIR="$PWD/miri-target"
20+
export MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-strict-provenance"
21+
22+
PARTITION=$((${BUILDKITE_PARALLEL_JOB:-0}+1))
23+
TOTAL=${BUILDKITE_PARALLEL_JOB_COUNT:-1}
24+
25+
# exclude network-based and more complex tests which run out of memory
26+
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*'

ci/test/cargo-test/mzcompose.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838

3939

4040
def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
41-
parser.add_argument("--miri", action="store_true")
41+
parser.add_argument("--miri-full", action="store_true")
42+
parser.add_argument("--miri-fast", action="store_true")
4243
parser.add_argument("args", nargs="*")
4344
args = parser.parse_args()
4445
c.up("zookeeper", "kafka", "schema-registry", "postgres", "cockroach")
@@ -108,11 +109,16 @@ def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
108109
["buildkite-agent", "artifact", "upload", "coverage/cargotest.lcov.xz"]
109110
)
110111
else:
111-
if args.miri:
112+
if args.miri_full:
112113
spawn.runv(
113114
["bin/ci-builder", "run", "nightly", "ci/test/cargo-test-miri.sh"],
114115
env=env,
115116
)
117+
elif args.miri_fast:
118+
spawn.runv(
119+
["bin/ci-builder", "run", "nightly", "ci/test/cargo-test-miri-fast.sh"],
120+
env=env,
121+
)
116122
else:
117123
spawn.runv(
118124
[

ci/test/pipeline.template.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,16 @@ steps:
155155
queue: builder-linux-x86_64
156156

157157
- id: miri-test
158-
label: Miri test %n
159-
command: bin/ci-builder run nightly ci/test/cargo-test-miri.sh
158+
label: Miri test (fast) %n
160159
inputs: [src]
161-
parallelism: 6
160+
parallelism: 2
162161
timeout_in_minutes: 30
163162
artifact_paths: [junit_*.xml, target/nextest/ci/junit_cargo-test.xml]
164163
plugins:
165164
- ./ci/plugins/scratch-aws-access: ~
166165
- ./ci/plugins/mzcompose:
167166
composition: cargo-test
168-
args: [--miri]
167+
args: [--miri-fast]
169168
agents:
170169
queue: builder-linux-x86_64
171170
coverage: skip

0 commit comments

Comments
 (0)