Skip to content

Commit

Permalink
miri: Try enabling epoll_wait
Browse files Browse the repository at this point in the history
  • Loading branch information
def- committed Jun 14, 2023
1 parent 6b760a9 commit 1ac4112
Show file tree
Hide file tree
Showing 31 changed files with 81 additions and 80 deletions.
14 changes: 14 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,29 @@ filter = "package(mz-environmentd) and test(test_pgtest)"
threads-required = 8
slow-timeout = { period = "300s", terminate-after = 2 }

[[profile.default-miri.overrides]]
filter = "package(mz-environmentd) and test(test_pgtest)"
threads-required = 8
slow-timeout = { period = "3000s", terminate-after = 2 }

[[profile.default.overrides]]
filter = "package(mz-environmentd)"
threads-required = 8
slow-timeout = { period = "120s", terminate-after = 2 }

[[profile.default-miri.overrides]]
filter = "package(mz-environmentd)"
threads-required = 8
slow-timeout = { period = "1200s", terminate-after = 2 }

[[profile.default.overrides]]
filter = "package(mz-stash) and test(proptest_stash_migrate_json_to_proto)"
slow-timeout = { period = "120s", terminate-after = 2 }

[[profile.default-miri.overrides]]
filter = "package(mz-stash) and test(proptest_stash_migrate_json_to_proto)"
slow-timeout = { period = "1200s", terminate-after = 2 }

[profile.ci]
junit = { path = "junit_cargo-test.xml" }
fail-fast = false
Expand Down
8 changes: 8 additions & 0 deletions bin/ci-builder
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ case "$cmd" in
--env NIGHTLY_CANARY_CONFLUENT_CLOUD_API_SECRET
--env NO_COLOR
--env PYPI_TOKEN
--env ZOOKEEPER_ADDR
--env KAFKA_ADDRS
--env SCHEMA_REGISTRY_URL
--env POSTGRES_URL
--env COCKROACH_URL
--env MZ_SOFT_ASSERTIONS
--env MZ_PERSIST_EXTERNAL_STORAGE_TEST_S3_BUCKET
--env MZ_PERSIST_EXTERNAL_STORAGE_TEST_POSTGRES_URL
)

if [[ $detach_container == "true" ]]; then
Expand Down
3 changes: 1 addition & 2 deletions ci/test/cargo-test-miri.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ set -euo pipefail
# so keep them away from the `target` directory.
export CARGO_TARGET_DIR="$PWD/miri-target"
export MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-strict-provenance"
# exclude netwrok based tests, they mostly fail on epoll_wait
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*'
cargo miri nextest run -j"$(nproc)" --no-fail-fast --workspace
32 changes: 18 additions & 14 deletions ci/test/cargo-test/mzcompose.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@


def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
parser.add_argument("--miri", action="store_true")
parser.add_argument("args", nargs="*")
args = parser.parse_args()
c.up("zookeeper", "kafka", "schema-registry", "postgres", "cockroach")
Expand Down Expand Up @@ -116,17 +117,20 @@ def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
],
env=env,
)
cpu_count = os.cpu_count()
assert cpu_count
spawn.runv(
[
"cargo",
"nextest",
"run",
"--profile=ci",
# Most tests don't use 100% of a CPU core, so run two tests per CPU.
f"--test-threads={cpu_count * 2}",
*args.args,
],
env=env,
)
if args.miri:
spawn.runv(["bin/ci-builder", "run", "nightly", "ci/test/cargo-test-miri.sh"], env=env)
else:
cpu_count = os.cpu_count()
assert cpu_count
spawn.runv(
[
"cargo",
"nextest",
"run",
"--profile=ci",
# Most tests don't use 100% of a CPU core, so run two tests per CPU.
f"--test-threads={cpu_count * 2}",
*args.args,
],
env=env,
)
19 changes: 17 additions & 2 deletions ci/test/pipeline.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,24 @@ steps:

- id: miri-test
label: Miri test
command: bin/ci-builder run nightly ci/test/cargo-test-miri.sh
inputs: [src]
timeout_in_minutes: 30
timeout_in_minutes: 60
artifact_paths: [junit_*.xml, target/nextest/ci/junit_cargo-test.xml]
inputs:
- Cargo.lock
- "**/Cargo.toml"
- "**/*.rs"
- "**/*.proto"
- "**/testdata/**"
env:
AWS_DEFAULT_REGION: "us-east-1"
# cargo-test's coverage is handled separately by cargo-llvm-cov
BUILDKITE_MZCOMPOSE_PLUGIN_SKIP_COVERAGE: "true"
plugins:
- ./ci/plugins/scratch-aws-access: ~
- ./ci/plugins/mzcompose:
composition: cargo-test
args: [--miri]
agents:
queue: builder-linux-x86_64
coverage: skip
Expand Down
2 changes: 2 additions & 0 deletions src/adapter/src/config/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ mod tests {
use super::SynchronizedParameters;

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

#[mz_ore::test]
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `decNumberFromInt32` on OS `linux`
fn test_vars_are_synced() {
let vars = SystemVars::default();
let sync = SynchronizedParameters::new(vars);
Expand Down
1 change: 1 addition & 0 deletions src/adapter/src/coord/peek.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ mod tests {
use super::*;

#[mz_ore::test]
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `rust_psm_stack_pointer` on OS `linux`
fn test_fast_path_plan_as_text() {
let typ = RelationType::new(vec![ColumnType {
scalar_type: ScalarType::String,
Expand Down
11 changes: 0 additions & 11 deletions src/environmentd/tests/pgwire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ fn test_bind_params() {
}

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

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

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

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

Expand Down Expand Up @@ -397,7 +393,6 @@ fn test_conn_user() {
}

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

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

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

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

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

#[mz_ore::test]
// unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
#[cfg_attr(miri, ignore)]
// Materialize's differences from Postgres' responses.
fn test_pgtest_mz() {
let dir: PathBuf = ["..", "..", "test", "pgtest-mz"].iter().collect();
Expand Down
10 changes: 0 additions & 10 deletions src/environmentd/tests/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ fn test_source_sink_size_required() {

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

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

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

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

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

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

#[mz_ore::test]
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
fn test_closing_connection_for_insert_select() {
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())
}
Expand Down Expand Up @@ -920,7 +913,6 @@ fn test_old_storage_usage_records_are_reaped_on_restart() {
}

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

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

#[mz_ore::test]
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
fn test_mz_system_user_admin() {
let config = util::Config::default();
let server = util::start_server(config).unwrap();
Expand Down
2 changes: 2 additions & 0 deletions src/expr/src/interpret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,7 @@ mod tests {
}

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

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

Expand Down
1 change: 1 addition & 0 deletions src/expr/src/scalar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2791,6 +2791,7 @@ mod tests {
use super::*;

#[mz_ore::test]
#[cfg_attr(miri, ignore)] // error: unsupported operation: can't call foreign function `rust_psm_stack_pointer` on OS `linux`
fn test_reduce() {
let relation_type = vec![
ScalarType::Int64.nullable(true),
Expand Down
3 changes: 0 additions & 3 deletions src/persist-client/src/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,6 @@ mod tests {
use super::*;

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

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

#[mz_ore::test(tokio::test)]
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
async fn batch_builder_partial_order() {
let cache = PersistClientCache::new_no_metrics();
// Set blob_target_size to 0 so that each row gets forced into its own batch part
Expand Down
1 change: 0 additions & 1 deletion src/persist-client/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,6 @@ mod tests {
use super::*;

#[mz_ore::test(tokio::test)]
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
async fn client_cache() {
let cache = PersistClientCache::new(
PersistConfig::new(&DUMMY_BUILD_INFO, SYSTEM_TIME.clone()),
Expand Down
2 changes: 0 additions & 2 deletions src/persist-client/src/critical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ mod tests {
}

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

Expand Down Expand Up @@ -405,7 +404,6 @@ mod tests {

// Verifies that the handle updates its view of the opaque token correctly
#[mz_ore::test(tokio::test)]
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
async fn handle_opaque_token() {
let client = new_test_client().await;
let shard_id = ShardId::new();
Expand Down
3 changes: 0 additions & 3 deletions src/persist-client/src/internal/compact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,6 @@ mod tests {
// made it to main) where batches written by compaction would always have a
// since of the minimum timestamp.
#[mz_ore::test(tokio::test)]
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `epoll_wait` on OS `linux`
async fn regression_minimum_since() {
let data = vec![
(("0".to_owned(), "zero".to_owned()), 0, 1),
Expand Down Expand Up @@ -1064,7 +1063,6 @@ mod tests {
}

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

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

0 comments on commit 1ac4112

Please sign in to comment.