-
Notifications
You must be signed in to change notification settings - Fork 523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(scale): introduce deterministic scaling tests #5657
Changes from 14 commits
2fa5c9c
ffd39db
d3b75ff
d30b66c
08e61b1
53d222f
9183918
99cd61a
6743964
b7861bc
8e89c8c
d887c4e
62703bb
821012c
f68b67b
9baad0e
c1d8bba
aa96954
f88edfa
c2ab7ba
4d1ee73
21df22d
b68306b
e275e05
1870972
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -495,11 +495,26 @@ cargo nextest run \ | |
"$@" | ||
""" | ||
|
||
[tasks.sarchive-scale-test] | ||
category = "RiseDev - Archive simulation scaling tests" | ||
description = "Archive integration scaling tests in deterministic simulation mode" | ||
dependencies = ["warn-on-missing-tools"] | ||
env = { RUSTFLAGS = "-Ctarget-cpu=native --cfg tokio_unstable --cfg madsim", RUSTDOCFLAGS = "--cfg madsim", CARGO_TARGET_DIR = "target/sim" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't decide how to enable SIMD this way through environments. Thus, the results of JSON parsing might be different due to precision errors like #5487. 🥵 |
||
script = """ | ||
#!/bin/bash | ||
set -e | ||
|
||
cargo nextest archive \ | ||
-p risingwave_simulation_scale \ | ||
--archive-file scale-test.tar.zst \ | ||
"$@" | ||
""" | ||
|
||
[tasks.sslt] | ||
category = "RiseDev - Deterministic Simulation End-to-end Test" | ||
description = "Run e2e tests in deterministic simulation mode" | ||
dependencies = ["warn-on-missing-tools"] | ||
env = { RUSTFLAGS = "--cfg tokio_unstable --cfg madsim", RUSTDOCFLAGS = "--cfg madsim", CARGO_TARGET_DIR = "target/sim" } | ||
env = { RUSTFLAGS = "-Ctarget-cpu=native --cfg tokio_unstable --cfg madsim", RUSTDOCFLAGS = "--cfg madsim", CARGO_TARGET_DIR = "target/sim" } | ||
script = """ | ||
#!/bin/bash | ||
set -e | ||
|
@@ -511,7 +526,7 @@ cargo run -p risingwave_simulation "$@" | |
category = "RiseDev - Deterministic Simulation End-to-end Test" | ||
description = "Run e2e tests in deterministic simulation mode and report code coverage" | ||
dependencies = ["warn-on-missing-tools"] | ||
env = { RUSTFLAGS = "--cfg tokio_unstable --cfg madsim", RUSTDOCFLAGS = "--cfg madsim", CARGO_TARGET_DIR = "target/sim-cov" } | ||
env = { RUSTFLAGS = "-Ctarget-cpu=native --cfg tokio_unstable --cfg madsim", RUSTDOCFLAGS = "--cfg madsim", CARGO_TARGET_DIR = "target/sim-cov" } | ||
script = """ | ||
#!/bin/bash | ||
set -e | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
# Exits as soon as any line fails. | ||
set -euo pipefail | ||
|
||
source ci/scripts/common.env.sh | ||
|
||
echo "--- Download artifacts" | ||
buildkite-agent artifact download scale-test.tar.zst . | ||
|
||
echo "--- Run scaling tests in deterministic simulation mode" | ||
MADSIM_TEST_NUM=5 cargo nextest run --archive-file scale-test.tar.zst --no-fail-fast |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
use std::time::{SystemTime, UNIX_EPOCH}; | ||
|
||
use anyhow::{Ok, Result}; | ||
use futures::future::pending; | ||
use futures_async_stream::try_stream; | ||
use risingwave_common::bail; | ||
|
||
|
@@ -43,7 +44,12 @@ impl NexmarkEventGenerator { | |
#[try_stream(ok = Vec<SourceMessage>, error = anyhow::Error)] | ||
pub async fn into_stream(mut self) { | ||
loop { | ||
yield self.next().await? | ||
let chunk = self.next().await?; | ||
if chunk.is_empty() { | ||
yield pending().await; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be CPU intensive if there are no remaining records to generate, which is problematic with madsim. 🤣 |
||
} else { | ||
yield chunk; | ||
} | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[package] | ||
name = "risingwave_simulation_scale" | ||
version = "0.1.0" | ||
edition = "2021" | ||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
anyhow = "1.0" | ||
async-trait = "0.1" | ||
clap = "3" | ||
futures = { version = "0.3", default-features = false, features = ["alloc"] } | ||
glob = "0.3" | ||
itertools = "0.10" | ||
madsim = "0.2.7" | ||
rand = "0.8" | ||
risingwave_compactor = { path = "../../storage/compactor" } | ||
risingwave_compute = { path = "../../compute" } | ||
risingwave_ctl = { path = "../../ctl" } | ||
risingwave_frontend = { path = "../../frontend" } | ||
risingwave_meta = { path = "../../meta" } | ||
risingwave_pb = { path = "../../prost" } | ||
sqllogictest = "0.6.4" | ||
tempfile = "3" | ||
tokio = { version = "0.2", package = "madsim-tokio" } | ||
tokio-postgres = "0.7.7" | ||
tracing = "0.1" | ||
|
||
[target.'cfg(not(madsim))'.dependencies] | ||
workspace-hack = { version = "0.1", path = "../../workspace-hack" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer merging it into the existing simulation crate, maybe in a future PR.