Skip to content

Commit 1ac4112

Browse files
committed
miri: Try enabling epoll_wait
1 parent 6b760a9 commit 1ac4112

File tree

31 files changed

+81
-80
lines changed

31 files changed

+81
-80
lines changed

.config/nextest.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,29 @@ filter = "package(mz-environmentd) and test(test_pgtest)"
1212
threads-required = 8
1313
slow-timeout = { period = "300s", terminate-after = 2 }
1414

15+
[[profile.default-miri.overrides]]
16+
filter = "package(mz-environmentd) and test(test_pgtest)"
17+
threads-required = 8
18+
slow-timeout = { period = "3000s", terminate-after = 2 }
19+
1520
[[profile.default.overrides]]
1621
filter = "package(mz-environmentd)"
1722
threads-required = 8
1823
slow-timeout = { period = "120s", terminate-after = 2 }
1924

25+
[[profile.default-miri.overrides]]
26+
filter = "package(mz-environmentd)"
27+
threads-required = 8
28+
slow-timeout = { period = "1200s", terminate-after = 2 }
29+
2030
[[profile.default.overrides]]
2131
filter = "package(mz-stash) and test(proptest_stash_migrate_json_to_proto)"
2232
slow-timeout = { period = "120s", terminate-after = 2 }
2333

34+
[[profile.default-miri.overrides]]
35+
filter = "package(mz-stash) and test(proptest_stash_migrate_json_to_proto)"
36+
slow-timeout = { period = "1200s", terminate-after = 2 }
37+
2438
[profile.ci]
2539
junit = { path = "junit_cargo-test.xml" }
2640
fail-fast = false

bin/ci-builder

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@ case "$cmd" in
180180
--env NIGHTLY_CANARY_CONFLUENT_CLOUD_API_SECRET
181181
--env NO_COLOR
182182
--env PYPI_TOKEN
183+
--env ZOOKEEPER_ADDR
184+
--env KAFKA_ADDRS
185+
--env SCHEMA_REGISTRY_URL
186+
--env POSTGRES_URL
187+
--env COCKROACH_URL
188+
--env MZ_SOFT_ASSERTIONS
189+
--env MZ_PERSIST_EXTERNAL_STORAGE_TEST_S3_BUCKET
190+
--env MZ_PERSIST_EXTERNAL_STORAGE_TEST_POSTGRES_URL
183191
)
184192

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

ci/test/cargo-test-miri.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ set -euo pipefail
1818
# so keep them away from the `target` directory.
1919
export CARGO_TARGET_DIR="$PWD/miri-target"
2020
export MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-strict-provenance"
21-
# exclude netwrok based tests, they mostly fail on epoll_wait
22-
cargo miri nextest run -j"$(nproc)" --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*'
21+
cargo miri nextest run -j"$(nproc)" --no-fail-fast --workspace

ci/test/cargo-test/mzcompose.py

Lines changed: 18 additions & 14 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")
@@ -116,17 +117,20 @@ def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
116117
],
117118
env=env,
118119
)
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-
f"--test-threads={cpu_count * 2}",
129-
*args.args,
130-
],
131-
env=env,
132-
)
120+
if args.miri:
121+
spawn.runv(["bin/ci-builder", "run", "nightly", "ci/test/cargo-test-miri.sh"], env=env)
122+
else:
123+
cpu_count = os.cpu_count()
124+
assert cpu_count
125+
spawn.runv(
126+
[
127+
"cargo",
128+
"nextest",
129+
"run",
130+
"--profile=ci",
131+
# Most tests don't use 100% of a CPU core, so run two tests per CPU.
132+
f"--test-threads={cpu_count * 2}",
133+
*args.args,
134+
],
135+
env=env,
136+
)

ci/test/pipeline.template.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,24 @@ steps:
155155

156156
- id: miri-test
157157
label: Miri test
158-
command: bin/ci-builder run nightly ci/test/cargo-test-miri.sh
159158
inputs: [src]
160-
timeout_in_minutes: 30
159+
timeout_in_minutes: 60
160+
artifact_paths: [junit_*.xml, target/nextest/ci/junit_cargo-test.xml]
161+
inputs:
162+
- Cargo.lock
163+
- "**/Cargo.toml"
164+
- "**/*.rs"
165+
- "**/*.proto"
166+
- "**/testdata/**"
167+
env:
168+
AWS_DEFAULT_REGION: "us-east-1"
169+
# cargo-test's coverage is handled separately by cargo-llvm-cov
170+
BUILDKITE_MZCOMPOSE_PLUGIN_SKIP_COVERAGE: "true"
171+
plugins:
172+
- ./ci/plugins/scratch-aws-access: ~
173+
- ./ci/plugins/mzcompose:
174+
composition: cargo-test
175+
args: [--miri]
161176
agents:
162177
queue: builder-linux-x86_64
163178
coverage: skip

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
@@ -584,6 +584,7 @@ mod tests {
584584
use super::*;
585585

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

src/environmentd/tests/pgwire.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ fn test_bind_params() {
171171
}
172172

173173
#[mz_ore::test]
174-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
175174
fn test_partial_read() {
176175
let server = util::start_server(util::Config::default()).unwrap();
177176
let mut client = server.connect(postgres::NoTls).unwrap();
@@ -198,7 +197,6 @@ fn test_partial_read() {
198197
}
199198

200199
#[mz_ore::test]
201-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
202200
fn test_read_many_rows() {
203201
let server = util::start_server(util::Config::default()).unwrap();
204202
let mut client = server.connect(postgres::NoTls).unwrap();
@@ -213,7 +211,6 @@ fn test_read_many_rows() {
213211
}
214212

215213
#[mz_ore::test]
216-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
217214
fn test_conn_startup() {
218215
let server = util::start_server(util::Config::default()).unwrap();
219216
let mut client = server.connect(postgres::NoTls).unwrap();
@@ -362,7 +359,6 @@ fn test_conn_startup() {
362359
}
363360

364361
#[mz_ore::test]
365-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
366362
fn test_conn_user() {
367363
let server = util::start_server(util::Config::default()).unwrap();
368364

@@ -397,7 +393,6 @@ fn test_conn_user() {
397393
}
398394

399395
#[mz_ore::test]
400-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
401396
fn test_simple_query_no_hang() {
402397
let server = util::start_server(util::Config::default()).unwrap();
403398
let mut client = server.connect(postgres::NoTls).unwrap();
@@ -407,7 +402,6 @@ fn test_simple_query_no_hang() {
407402
}
408403

409404
#[mz_ore::test]
410-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
411405
fn test_copy() {
412406
let server = util::start_server(util::Config::default()).unwrap();
413407
let mut client = server.connect(postgres::NoTls).unwrap();
@@ -457,7 +451,6 @@ fn test_copy() {
457451
}
458452

459453
#[mz_ore::test]
460-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
461454
fn test_arrays() {
462455
let server = util::start_server(util::Config::default().unsafe_mode()).unwrap();
463456
let mut client = server.connect(postgres::NoTls).unwrap();
@@ -505,7 +498,6 @@ fn test_arrays() {
505498
}
506499

507500
#[mz_ore::test]
508-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
509501
fn test_record_types() {
510502
let server = util::start_server(util::Config::default()).unwrap();
511503
let mut client = server.connect(postgres::NoTls).unwrap();
@@ -573,15 +565,12 @@ fn pg_test_inner(dir: PathBuf, flags: &[&'static str]) {
573565
}
574566

575567
#[mz_ore::test]
576-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
577568
fn test_pgtest() {
578569
let dir: PathBuf = ["..", "..", "test", "pgtest"].iter().collect();
579570
pg_test_inner(dir, &[]);
580571
}
581572

582573
#[mz_ore::test]
583-
// unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
584-
#[cfg_attr(miri, ignore)]
585574
// Materialize's differences from Postgres' responses.
586575
fn test_pgtest_mz() {
587576
let dir: PathBuf = ["..", "..", "test", "pgtest-mz"].iter().collect();

src/environmentd/tests/server.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ fn test_source_sink_size_required() {
243243

244244
// Test the POST and WS server endpoints.
245245
#[mz_ore::test]
246-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
247246
fn test_http_sql() {
248247
// Datadriven directives for WebSocket are "ws-text" and "ws-binary" to send
249248
// text or binary websocket messages that are the input. Output is
@@ -347,7 +346,6 @@ fn test_http_sql() {
347346

348347
// Test that the server properly handles cancellation requests.
349348
#[mz_ore::test]
350-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
351349
fn test_cancel_long_running_query() {
352350
let config = util::Config::default().unsafe_mode();
353351
let server = util::start_server(config).unwrap();
@@ -459,19 +457,16 @@ fn test_cancellation_cancels_dataflows(query: &str) {
459457

460458
// Test that dataflow uninstalls cancelled peeks.
461459
#[mz_ore::test]
462-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
463460
fn test_cancel_dataflow_removal() {
464461
test_cancellation_cancels_dataflows("SELECT * FROM t AS OF 9223372036854775807");
465462
}
466463

467464
#[mz_ore::test]
468-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
469465
fn test_cancel_long_select() {
470466
test_cancellation_cancels_dataflows("WITH MUTUALLY RECURSIVE flip(x INTEGER) AS (VALUES(1) EXCEPT ALL SELECT * FROM flip) SELECT * FROM flip;");
471467
}
472468

473469
#[mz_ore::test]
474-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
475470
fn test_cancel_insert_select() {
476471
test_cancellation_cancels_dataflows("INSERT INTO t WITH MUTUALLY RECURSIVE flip(x INTEGER) AS (VALUES(1) EXCEPT ALL SELECT * FROM flip) SELECT * FROM flip;");
477472
}
@@ -566,13 +561,11 @@ fn test_closing_connection_cancels_dataflows(query: String) {
566561
}
567562

568563
#[mz_ore::test]
569-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
570564
fn test_closing_connection_for_long_select() {
571565
test_closing_connection_cancels_dataflows("WITH MUTUALLY RECURSIVE flip(x INTEGER) AS (VALUES(1) EXCEPT ALL SELECT * FROM flip) SELECT * FROM flip;".to_string())
572566
}
573567

574568
#[mz_ore::test]
575-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
576569
fn test_closing_connection_for_insert_select() {
577570
test_closing_connection_cancels_dataflows("CREATE TABLE t1 (a int); INSERT INTO t1 WITH MUTUALLY RECURSIVE flip(x INTEGER) AS (VALUES(1) EXCEPT ALL SELECT * FROM flip) SELECT * FROM flip;".to_string())
578571
}
@@ -920,7 +913,6 @@ fn test_old_storage_usage_records_are_reaped_on_restart() {
920913
}
921914

922915
#[mz_ore::test]
923-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
924916
fn test_default_cluster_sizes() {
925917
let config = util::Config::default()
926918
.with_builtin_cluster_replica_size("1".to_string())
@@ -952,7 +944,6 @@ fn test_default_cluster_sizes() {
952944
}
953945

954946
#[mz_ore::test]
955-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
956947
fn test_max_request_size() {
957948
let statement = "SELECT $1::text";
958949
let statement_size = statement.bytes().count();
@@ -1088,7 +1079,6 @@ fn test_max_statement_batch_size() {
10881079
}
10891080

10901081
#[mz_ore::test]
1091-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
10921082
fn test_mz_system_user_admin() {
10931083
let config = util::Config::default();
10941084
let server = util::start_server(config).unwrap();

src/expr/src/interpret.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,7 @@ mod tests {
12121212
}
12131213

12141214
#[mz_ore::test]
1215+
#[cfg_attr(miri, ignore)] // error: unsupported operation: can't call foreign function `decContextDefault` on OS `linux`
12151216
fn test_equivalence() {
12161217
fn check(data: ExpressionData) -> Result<(), TestCaseError> {
12171218
let ExpressionData {
@@ -1385,6 +1386,7 @@ mod tests {
13851386
}
13861387

13871388
#[mz_ore::test]
1389+
#[cfg_attr(miri, ignore)] // error: unsupported operation: can't call foreign function `decNumberFromInt32` on OS `linux`
13881390
fn test_jsonb() {
13891391
let arena = RowArena::new();
13901392

src/expr/src/scalar/mod.rs

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

27932793
#[mz_ore::test]
2794+
#[cfg_attr(miri, ignore)] // error: unsupported operation: can't call foreign function `rust_psm_stack_pointer` on OS `linux`
27942795
fn test_reduce() {
27952796
let relation_type = vec![
27962797
ScalarType::Int64.nullable(true),

src/persist-client/src/batch.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,6 @@ mod tests {
869869
use super::*;
870870

871871
#[mz_ore::test(tokio::test)]
872-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
873872
async fn batch_builder_flushing() {
874873
let data = vec![
875874
(("1".to_owned(), "one".to_owned()), 1, 1),
@@ -962,7 +961,6 @@ mod tests {
962961
}
963962

964963
#[mz_ore::test(tokio::test)]
965-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
966964
async fn batch_builder_keys() {
967965
let cache = PersistClientCache::new_no_metrics();
968966
// Set blob_target_size to 0 so that each row gets forced into its own batch part
@@ -1004,7 +1002,6 @@ mod tests {
10041002
}
10051003

10061004
#[mz_ore::test(tokio::test)]
1007-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
10081005
async fn batch_builder_partial_order() {
10091006
let cache = PersistClientCache::new_no_metrics();
10101007
// Set blob_target_size to 0 so that each row gets forced into its own batch part

src/persist-client/src/cache.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,6 @@ mod tests {
656656
use super::*;
657657

658658
#[mz_ore::test(tokio::test)]
659-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
660659
async fn client_cache() {
661660
let cache = PersistClientCache::new(
662661
PersistConfig::new(&DUMMY_BUILD_INFO, SYSTEM_TIME.clone()),

src/persist-client/src/critical.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ mod tests {
377377
}
378378

379379
#[mz_ore::test(tokio::test)]
380-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
381380
async fn rate_limit() {
382381
let client = crate::tests::new_test_client().await;
383382

@@ -405,7 +404,6 @@ mod tests {
405404

406405
// Verifies that the handle updates its view of the opaque token correctly
407406
#[mz_ore::test(tokio::test)]
408-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
409407
async fn handle_opaque_token() {
410408
let client = new_test_client().await;
411409
let shard_id = ShardId::new();

src/persist-client/src/internal/compact.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,6 @@ mod tests {
996996
// made it to main) where batches written by compaction would always have a
997997
// since of the minimum timestamp.
998998
#[mz_ore::test(tokio::test)]
999-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
1000999
async fn regression_minimum_since() {
10011000
let data = vec![
10021001
(("0".to_owned(), "zero".to_owned()), 0, 1),
@@ -1064,7 +1063,6 @@ mod tests {
10641063
}
10651064

10661065
#[mz_ore::test(tokio::test)]
1067-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
10681066
async fn compaction_partial_order() {
10691067
let data = vec![
10701068
(
@@ -1150,7 +1148,6 @@ mod tests {
11501148
}
11511149

11521150
#[mz_ore::test(tokio::test)]
1153-
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
11541151
async fn prefetches() {
11551152
let desc = Description::new(
11561153
Antichain::from_elem(0u64),

0 commit comments

Comments
 (0)