Skip to content

Commit

Permalink
update results in release mode
Browse files Browse the repository at this point in the history
Signed-off-by: Runji Wang <wangrunji0408@163.com>
  • Loading branch information
wangrunji0408 committed Jan 31, 2023
1 parent 7a1751d commit ab880b0
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 66 deletions.
36 changes: 17 additions & 19 deletions src/tests/simulation/tests/nexmark_recovery.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 madsim::time::{sleep, sleep_until, Instant};
use madsim::time::{sleep, Instant};
use risingwave_simulation::cluster::{Configuration, KillOpts};
use risingwave_simulation::nexmark::{self, NexmarkCluster, THROUGHPUT};

Expand All @@ -32,14 +32,12 @@ async fn nexmark_recovery() -> Result<()> {
NexmarkCluster::new(Configuration::for_scale(), 2, Some(THROUGHPUT * 20)).await?;

// note: feel free to disable queries to speed up the test
// cluster.run(nexmark::queries::q3::CREATE).await.unwrap();
cluster.run(nexmark::queries::q3::CREATE).await.unwrap();
cluster.run(nexmark::queries::q4::CREATE).await.unwrap();
// cluster.run(nexmark::queries::q5::CREATE).await.unwrap();
// cluster.run(nexmark::queries::q7::CREATE).await.unwrap();
// cluster.run(nexmark::queries::q8::CREATE).await.unwrap();
// cluster.run(nexmark::queries::q9::CREATE).await.unwrap();

let t0 = Instant::now();
cluster.run(nexmark::queries::q5::CREATE).await.unwrap();
cluster.run(nexmark::queries::q7::CREATE).await.unwrap();
cluster.run(nexmark::queries::q8::CREATE).await.unwrap();
cluster.run(nexmark::queries::q9::CREATE).await.unwrap();

// kill nodes and trigger recovery
for _ in 0..5 {
Expand All @@ -48,14 +46,14 @@ async fn nexmark_recovery() -> Result<()> {
}

// make sure running for enough time
sleep_until(t0 + Duration::from_secs(30)).await;
sleep(Duration::from_secs(30)).await;

// let q3 = cluster.run(nexmark::queries::q3::SELECT).await.unwrap();
let q3 = cluster.run(nexmark::queries::q3::SELECT).await.unwrap();
let q4 = cluster.run(nexmark::queries::q4::SELECT).await.unwrap();
// let q5 = cluster.run(nexmark::queries::q5::SELECT).await.unwrap();
// let q7 = cluster.run(nexmark::queries::q7::SELECT).await.unwrap();
// let q8 = cluster.run(nexmark::queries::q8::SELECT).await.unwrap();
// let q9 = cluster.run(nexmark::queries::q9::SELECT).await.unwrap();
let q5 = cluster.run(nexmark::queries::q5::SELECT).await.unwrap();
let q7 = cluster.run(nexmark::queries::q7::SELECT).await.unwrap();
let q8 = cluster.run(nexmark::queries::q8::SELECT).await.unwrap();
let q9 = cluster.run(nexmark::queries::q9::SELECT).await.unwrap();

// uncomment the following lines to generate results
// std::fs::write("tests/nexmark_result/q3.txt", q3).unwrap();
Expand All @@ -65,11 +63,11 @@ async fn nexmark_recovery() -> Result<()> {
// std::fs::write("tests/nexmark_result/q8.txt", q8).unwrap();
// std::fs::write("tests/nexmark_result/q9.txt", q9).unwrap();

// assert_eq!(q3, include_str!("nexmark_result/q3.txt"));
assert_eq!(q3, include_str!("nexmark_result/q3.txt"));
assert_eq!(q4, include_str!("nexmark_result/q4.txt"));
// assert_eq!(q5, include_str!("nexmark_result/q5.txt"));
// assert_eq!(q7, include_str!("nexmark_result/q7.txt"));
// assert_eq!(q8, include_str!("nexmark_result/q8.txt"));
// assert_eq!(q9, include_str!("nexmark_result/q9.txt"));
assert_eq!(q5, include_str!("nexmark_result/q5.txt"));
assert_eq!(q7, include_str!("nexmark_result/q7.txt"));
assert_eq!(q8, include_str!("nexmark_result/q8.txt"));
assert_eq!(q9, include_str!("nexmark_result/q9.txt"));
Ok(())
}
10 changes: 5 additions & 5 deletions src/tests/simulation/tests/nexmark_result/q4.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
10 28586726.810786106032906764168
11 29089413.531167690956979806848
12 29245370.427782888684452621895
13 30910968.113309352517985611511
14 26961712.806972789115646258503
10 28586726.800731261425959780622
11 29089413.539069359086918349429
12 29245370.459981600735970561178
13 30910968.119604316546762589928
14 26961712.796768707482993197279
Loading

0 comments on commit ab880b0

Please sign in to comment.