Skip to content
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: add recovery in nexmark q4 sim test #18577

Merged
merged 3 commits into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 44 additions & 12 deletions src/tests/simulation/tests/integration_tests/scale/nexmark_q4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::time::Duration;
use anyhow::Result;
use itertools::Itertools;
use risingwave_common::hash::WorkerSlotId;
use risingwave_simulation::cluster::Configuration;
use risingwave_simulation::cluster::{Configuration, KillOpts};
use risingwave_simulation::ctl_ext::predicate::{
identity_contains, upstream_fragment_count, BoxedPredicate,
};
Expand Down Expand Up @@ -67,7 +67,10 @@ async fn nexmark_q4_ref() -> Result<()> {
Ok(())
}

async fn nexmark_q4_common(predicates: impl IntoIterator<Item = BoxedPredicate>) -> Result<()> {
async fn nexmark_q4_common(
predicates: impl IntoIterator<Item = BoxedPredicate>,
recovery: bool,
) -> Result<()> {
let mut cluster = init().await?;

let fragment = cluster.locate_one_fragment(predicates).await?;
Expand Down Expand Up @@ -108,6 +111,13 @@ async fn nexmark_q4_common(predicates: impl IntoIterator<Item = BoxedPredicate>)

sleep(Duration::from_secs(20)).await;

if recovery {
// Trigger recovery
cluster.kill_node(&KillOpts::ALL).await;

sleep(Duration::from_secs(5)).await;
}

// 25~35s
cluster.run(SELECT).await?.assert_result_eq(RESULT);

Expand All @@ -116,25 +126,47 @@ async fn nexmark_q4_common(predicates: impl IntoIterator<Item = BoxedPredicate>)

#[tokio::test]
async fn nexmark_q4_materialize_agg() -> Result<()> {
nexmark_q4_common([
identity_contains("materialize"),
identity_contains("hashagg"),
])
nexmark_q4_common(
[
identity_contains("materialize"),
identity_contains("hashagg"),
],
false,
)
.await
}
#[tokio::test]
async fn nexmark_q4_materialize_agg_with_recovery() -> Result<()> {
nexmark_q4_common(
[
identity_contains("materialize"),
identity_contains("hashagg"),
],
true,
)
.await
}

#[tokio::test]
async fn nexmark_q4_source() -> Result<()> {
nexmark_q4_common([identity_contains("source: bid")]).await
nexmark_q4_common([identity_contains("source: bid")], false).await
}

#[tokio::test]
async fn nexmark_q4_source_with_recovery() -> Result<()> {
nexmark_q4_common([identity_contains("source: bid")], true).await
}

#[tokio::test]
async fn nexmark_q4_agg_join() -> Result<()> {
nexmark_q4_common([
identity_contains("hashagg"),
identity_contains("hashjoin"),
upstream_fragment_count(2),
])
nexmark_q4_common(
[
identity_contains("hashagg"),
identity_contains("hashjoin"),
upstream_fragment_count(2),
],
false,
)
.await
}

Expand Down
Loading