Skip to content

Commit c019367

Browse files
committed
miri: Enable tests using epoll_wait
Based on recent segfaults we definitely want more Miri testing.
1 parent a8dba2c commit c019367

File tree

59 files changed

+131
-89
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+131
-89
lines changed

.config/nextest.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
slow-timeout = { period = "60s", terminate-after = 2 }
33

44
[profile.default-miri]
5-
slow-timeout = { period = "600s", terminate-after = 2 }
5+
slow-timeout = { period = "1200s", terminate-after = 2 }
66

77
# For a given configuration parameter, the first override to match wins. Keep
88
# these sorted in order from most specific to least specific.

bin/ci-builder

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@ case "$cmd" in
180180
--env NIGHTLY_CANARY_CONFLUENT_CLOUD_API_SECRET
181181
--env NO_COLOR
182182
--env PYPI_TOKEN
183+
# For Miri with nightly Rust
184+
--env ZOOKEEPER_ADDR
185+
--env KAFKA_ADDRS
186+
--env SCHEMA_REGISTRY_URL
187+
--env POSTGRES_URL
188+
--env COCKROACH_URL
189+
--env MZ_SOFT_ASSERTIONS
183190
)
184191

185192
if [[ $detach_container == "true" ]]; then

ci/test/cargo-test-miri.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ export MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-strict-provenance"
2222
PARTITION=$((${BUILDKITE_PARALLEL_JOB:-0}+1))
2323
TOTAL=${BUILDKITE_PARALLEL_JOB_COUNT:-1}
2424

25-
# exclude netwrok based tests, they mostly fail on epoll_wait
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*'
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-environmentd*' --exclude 'mz-compute-client*' --exclude 'mz-ssh-util*' --exclude 'mz-rocksdb*'

ci/test/cargo-test/mzcompose.py

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939

4040
def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
41+
parser.add_argument("--miri", action="store_true")
4142
parser.add_argument("args", nargs="*")
4243
args = parser.parse_args()
4344
c.up("zookeeper", "kafka", "schema-registry", "postgres", "cockroach")
@@ -107,27 +108,33 @@ def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
107108
["buildkite-agent", "artifact", "upload", "coverage/cargotest.lcov.xz"]
108109
)
109110
else:
110-
spawn.runv(
111-
[
112-
"cargo",
113-
"build",
114-
"--bin",
115-
"clusterd",
116-
],
117-
env=env,
118-
)
119-
cpu_count = os.cpu_count()
120-
assert cpu_count
121-
spawn.runv(
122-
[
123-
"cargo",
124-
"nextest",
125-
"run",
126-
"--profile=ci",
127-
# Most tests don't use 100% of a CPU core, so run two tests per CPU.
128-
# TODO(def-): Reenable when #19931 is fixed
129-
# f"--test-threads={cpu_count * 2}",
130-
*args.args,
131-
],
132-
env=env,
133-
)
111+
if args.miri:
112+
spawn.runv(
113+
["bin/ci-builder", "run", "nightly", "ci/test/cargo-test-miri.sh"],
114+
env=env,
115+
)
116+
else:
117+
spawn.runv(
118+
[
119+
"cargo",
120+
"build",
121+
"--bin",
122+
"clusterd",
123+
],
124+
env=env,
125+
)
126+
cpu_count = os.cpu_count()
127+
assert cpu_count
128+
spawn.runv(
129+
[
130+
"cargo",
131+
"nextest",
132+
"run",
133+
"--profile=ci",
134+
# Most tests don't use 100% of a CPU core, so run two tests per CPU.
135+
# TODO(def-): Reenable when #19931 is fixed
136+
# f"--test-threads={cpu_count * 2}",
137+
*args.args,
138+
],
139+
env=env,
140+
)

ci/test/pipeline.template.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,14 @@ steps:
158158
label: Miri test %n
159159
command: bin/ci-builder run nightly ci/test/cargo-test-miri.sh
160160
inputs: [src]
161-
parallelism: 2
161+
parallelism: 6
162162
timeout_in_minutes: 30
163+
artifact_paths: [junit_*.xml, target/nextest/ci/junit_cargo-test.xml]
164+
plugins:
165+
- ./ci/plugins/scratch-aws-access: ~
166+
- ./ci/plugins/mzcompose:
167+
composition: cargo-test
168+
args: [--miri]
163169
agents:
164170
queue: builder-linux-x86_64
165171
coverage: skip

src/adapter/src/catalog.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8791,6 +8791,7 @@ mod tests {
87918791
/// search paths, so do not require schema qualification on system objects such
87928792
/// as types.
87938793
#[mz_ore::test(tokio::test)]
8794+
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `TLS_client_method` on OS `linux`
87948795
async fn test_minimal_qualification() {
87958796
Catalog::with_debug(NOW_ZERO.clone(), |catalog| async move {
87968797
struct TestCase {
@@ -8863,6 +8864,7 @@ mod tests {
88638864
}
88648865

88658866
#[mz_ore::test(tokio::test)]
8867+
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `TLS_client_method` on OS `linux`
88668868
async fn test_catalog_revision() {
88678869
let debug_stash_factory = DebugStashFactory::new().await;
88688870
{
@@ -8898,6 +8900,7 @@ mod tests {
88988900
}
88998901

89008902
#[mz_ore::test(tokio::test)]
8903+
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `TLS_client_method` on OS `linux`
89018904
async fn test_effective_search_path() {
89028905
Catalog::with_debug(NOW_ZERO.clone(), |catalog| async move {
89038906
let mz_catalog_schema = (
@@ -9043,6 +9046,7 @@ mod tests {
90439046
}
90449047

90459048
#[mz_ore::test(tokio::test)]
9049+
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `TLS_client_method` on OS `linux`
90469050
async fn test_builtin_migration() {
90479051
enum ItemNamespace {
90489052
System,
@@ -9697,6 +9701,7 @@ mod tests {
96979701
}
96989702

96999703
#[mz_ore::test(tokio::test)]
9704+
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `TLS_client_method` on OS `linux`
97009705
async fn test_normalized_create() {
97019706
Catalog::with_debug(NOW_ZERO.clone(), |catalog| {
97029707
let catalog = catalog.for_system_session();
@@ -9864,6 +9869,7 @@ mod tests {
98649869
}
98659870

98669871
#[mz_ore::test(tokio::test)]
9872+
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `TLS_client_method` on OS `linux`
98679873
async fn test_object_type() {
98689874
let debug_stash_factory = DebugStashFactory::new().await;
98699875
let stash = debug_stash_factory.open_debug().await;
@@ -9883,6 +9889,7 @@ mod tests {
98839889
}
98849890

98859891
#[mz_ore::test(tokio::test)]
9892+
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `TLS_client_method` on OS `linux`
98869893
async fn test_get_privileges() {
98879894
let debug_stash_factory = DebugStashFactory::new().await;
98889895
let stash = debug_stash_factory.open_debug().await;

src/adapter/src/catalog/builtin.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4206,6 +4206,7 @@ mod tests {
42064206
// Connect to a running Postgres server and verify that our builtin
42074207
// types and functions match it, in addition to some other things.
42084208
#[mz_ore::test(tokio::test)]
4209+
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `TLS_client_method` on OS `linux`
42094210
async fn test_compare_builtins_postgres() {
42104211
async fn inner(catalog: Catalog) {
42114212
// Verify that all builtin functions:
@@ -4557,6 +4558,7 @@ mod tests {
45574558

45584559
// Execute all builtin functions with all combinations of arguments from interesting datums.
45594560
#[mz_ore::test(tokio::test)]
4561+
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `TLS_client_method` on OS `linux`
45604562
async fn test_smoketest_all_builtins() {
45614563
fn inner(catalog: Catalog) {
45624564
let conn_catalog = catalog.for_system_session();
@@ -4797,6 +4799,7 @@ mod tests {
47974799

47984800
// Make sure pg views don't use types that only exist in Materialize.
47994801
#[mz_ore::test(tokio::test)]
4802+
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `TLS_client_method` on OS `linux`
48004803
async fn test_pg_views_forbidden_types() {
48014804
Catalog::with_debug(SYSTEM_TIME.clone(), |catalog| async move {
48024805
let conn_catalog = catalog.for_system_session();

src/adapter/src/catalog/storage.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2131,6 +2131,7 @@ mod test {
21312131

21322132
proptest! {
21332133
#[mz_ore::test]
2134+
#[cfg_attr(miri, ignore)] // slow
21342135
fn proptest_database_key_roundtrip(key: DatabaseKey) {
21352136
let proto = key.into_proto();
21362137
let round = proto.into_rust().expect("to roundtrip");
@@ -2139,6 +2140,7 @@ mod test {
21392140
}
21402141

21412142
#[mz_ore::test]
2143+
#[cfg_attr(miri, ignore)] // slow
21422144
fn proptest_database_value_roundtrip(value: DatabaseValue) {
21432145
let proto = value.into_proto();
21442146
let round = proto.into_rust().expect("to roundtrip");
@@ -2147,6 +2149,7 @@ mod test {
21472149
}
21482150

21492151
#[mz_ore::test]
2152+
#[cfg_attr(miri, ignore)] // slow
21502153
fn proptest_schema_key_roundtrip(key: SchemaKey) {
21512154
let proto = key.into_proto();
21522155
let round = proto.into_rust().expect("to roundtrip");
@@ -2155,6 +2158,7 @@ mod test {
21552158
}
21562159

21572160
#[mz_ore::test]
2161+
#[cfg_attr(miri, ignore)] // slow
21582162
fn proptest_schema_value_roundtrip(value: SchemaValue) {
21592163
let proto = value.into_proto();
21602164
let round = proto.into_rust().expect("to roundtrip");
@@ -2163,6 +2167,7 @@ mod test {
21632167
}
21642168

21652169
#[mz_ore::test]
2170+
#[cfg_attr(miri, ignore)] // slow
21662171
fn proptest_item_key_roundtrip(key: ItemKey) {
21672172
let proto = key.into_proto();
21682173
let round = proto.into_rust().expect("to roundtrip");
@@ -2171,6 +2176,7 @@ mod test {
21712176
}
21722177

21732178
#[mz_ore::test]
2179+
#[cfg_attr(miri, ignore)] // slow
21742180
fn proptest_item_value_roundtrip(value: ItemValue) {
21752181
let proto = value.into_proto();
21762182
let round = proto.into_rust().expect("to roundtrip");

src/adapter/src/config/params.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ mod tests {
146146
use super::SynchronizedParameters;
147147

148148
#[mz_ore::test]
149+
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `decNumberFromInt32` on OS `linux`
149150
fn test_github_18189() {
150151
let vars = SystemVars::default();
151152
let mut sync = SynchronizedParameters::new(vars);
@@ -156,6 +157,7 @@ mod tests {
156157
}
157158

158159
#[mz_ore::test]
160+
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `decNumberFromInt32` on OS `linux`
159161
fn test_vars_are_synced() {
160162
let vars = SystemVars::default();
161163
let sync = SynchronizedParameters::new(vars);

src/adapter/src/coord/peek.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,7 @@ mod tests {
581581
use super::*;
582582

583583
#[mz_ore::test]
584+
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `rust_psm_stack_pointer` on OS `linux`
584585
fn test_fast_path_plan_as_text() {
585586
let typ = RelationType::new(vec![ColumnType {
586587
scalar_type: ScalarType::String,

src/adapter/tests/parameters.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ use mz_repr::ScalarType;
8080
use mz_sql::plan::PlanContext;
8181

8282
#[mz_ore::test(tokio::test)]
83+
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `TLS_client_method` on OS `linux`
8384
async fn test_parameter_type_inference() {
8485
let test_cases = vec![
8586
(

src/adapter/tests/sql.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ use tokio::sync::Mutex;
105105
// catalog.
106106

107107
#[mz_ore::test(tokio::test)]
108+
#[cfg_attr(miri, ignore)] // error: unsupported operation: can't call foreign function `TLS_client_method` on OS `linux`
108109
async fn datadriven() {
109110
datadriven::walk_async("tests/testdata/sql", |mut f| async {
110111
// The datadriven API takes an `FnMut` closure, and can't express to Rust that

src/adapter/tests/timestamp_selection.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ fn parse_query_when(s: &str) -> QueryWhen {
261261
/// returns the chosen timestamp. Append `full` as an argument to it to see the entire
262262
/// TimestampDetermination.
263263
#[mz_ore::test]
264+
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `decNumberFromInt32` on OS `linux`
264265
fn test_timestamp_selection() {
265266
datadriven::walk("tests/testdata/timestamp_selection", |tf| {
266267
let mut f = Frontiers {

src/avro/src/writer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ mod tests {
586586
}
587587

588588
#[mz_ore::test]
589+
#[cfg_attr(miri, ignore)] // slow
589590
fn test_writer_roundtrip() {
590591
let schema = Schema::from_str(SCHEMA).unwrap();
591592
let make_record = |a: i64, b| {

src/cluster-client/src/client.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ mod tests {
208208
}
209209

210210
#[mz_ore::test]
211+
#[cfg_attr(miri, ignore)] // slow
211212
fn cluster_startup_epoch_protobuf_roundtrip(expect in any::<ClusterStartupEpoch>() ) {
212213
let actual = protobuf_roundtrip::<_, ProtoClusterStartupEpoch>(&expect);
213214
assert!(actual.is_ok());

src/compute-client/src/plan/join/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ mod tests {
421421
#![proptest_config(ProptestConfig::with_cases(32))]
422422

423423
#[mz_ore::test]
424+
#[cfg_attr(miri, ignore)] // error: unsupported operation: can't call foreign function `decContextDefault` on OS `linux`
424425
fn join_plan_protobuf_roundtrip(expect in any::<JoinPlan>() ) {
425426
let actual = protobuf_roundtrip::<_, ProtoJoinPlan>(&expect);
426427
assert!(actual.is_ok());

src/compute-client/src/plan/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2197,6 +2197,7 @@ mod tests {
21972197
proptest! {
21982198
#![proptest_config(ProptestConfig::with_cases(10))]
21992199
#[mz_ore::test]
2200+
#[cfg_attr(miri, ignore)] // error: unsupported operation: can't call foreign function `decContextDefault` on OS `linux`
22002201
fn get_plan_protobuf_roundtrip(expect in any::<GetPlan>()) {
22012202
let actual = protobuf_roundtrip::<_, ProtoGetPlan>(&expect);
22022203
assert!(actual.is_ok());

src/compute-client/src/protocol/command.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ mod tests {
522522
#![proptest_config(ProptestConfig::with_cases(32))]
523523

524524
#[mz_ore::test]
525+
#[cfg_attr(miri, ignore)] // error: unsupported operation: can't call foreign function `decContextDefault` on OS `linux`
525526
fn peek_protobuf_roundtrip(expect in any::<Peek>() ) {
526527
let actual = protobuf_roundtrip::<_, ProtoPeek>(&expect);
527528
assert!(actual.is_ok());

0 commit comments

Comments
 (0)