Skip to content

Commit

Permalink
chore(fuzz): print table name for debugging (#4738)
Browse files Browse the repository at this point in the history
* chore(fuzz): print table name for debugging

* chore: apply suggestions
  • Loading branch information
WenyXu committed Sep 19, 2024
1 parent d0f5b2a commit 4900439
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,12 @@ async fn execute_failover(ctx: FuzzContext, input: FuzzInput) -> Result<()> {
for (table_ctx, insert_expr) in tables.values() {
let sql = format!("select count(1) as count from {}", table_ctx.name);
let values = count_values(&ctx.greptime, &sql).await?;
assert_eq!(values.count as usize, insert_expr.values_list.len());
let expected_rows = insert_expr.values_list.len() as u64;
assert_eq!(
values.count as u64, expected_rows,
"Expected rows: {}, got: {}, table: {}",
expected_rows, values.count, table_ctx.name
);
}

// Clean up
Expand Down
6 changes: 5 additions & 1 deletion tests-fuzz/targets/failover/fuzz_failover_mito_regions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,11 @@ async fn execute_failover(ctx: FuzzContext, input: FuzzInput) -> Result<()> {
for (table_ctx, expected_rows) in table_ctxs.iter().zip(affected_rows) {
let sql = format!("select count(1) as count from {}", table_ctx.name);
let values = count_values(&ctx.greptime, &sql).await?;
assert_eq!(values.count as u64, expected_rows);
assert_eq!(
values.count as u64, expected_rows,
"Expected rows: {}, got: {}, table: {}",
expected_rows, values.count, table_ctx.name
);
}

for table_ctx in table_ctxs {
Expand Down

0 comments on commit 4900439

Please sign in to comment.