Skip to content

Commit

Permalink
support table in creating procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Nov 21, 2023
1 parent e058534 commit d45042c
Showing 1 changed file with 29 additions and 22 deletions.
51 changes: 29 additions & 22 deletions src/tests/simulation/src/slt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,30 +299,37 @@ pub async fn run_slt_task(
}
break;
}
// allow 'table exists' error when retry CREATE statement
Err(e)
if matches!(
cmd,
Err(e) => {
match cmd {
// allow 'table exists' error when retry CREATE statement
SqlCmd::Create {
is_create_table_as: false
} | SqlCmd::CreateMaterializedView { .. }
) && i != 0
&& e.to_string().contains("exists")
&& e.to_string().contains("Catalog error") =>
{
break
}
// allow 'not found' error when retry DROP statement
Err(e)
if cmd == SqlCmd::Drop
&& i != 0
&& e.to_string().contains("not found")
&& e.to_string().contains("Catalog error") =>
{
break
is_create_table_as: false,
}
| SqlCmd::CreateMaterializedView { .. }
if i != 0
&& e.to_string().contains("exists")
&& e.to_string().contains("Catalog error") =>
{
break
}
SqlCmd::CreateMaterializedView { .. }
if i != 0
&& e.to_string().contains("table is in creating procedure") =>
{
break
}
// allow 'not found' error when retry DROP statement
SqlCmd::Drop
if i != 0
&& e.to_string().contains("not found")
&& e.to_string().contains("Catalog error") =>
{
break
}
_ if i >= 5 => panic!("failed to run test after retry {i} times: {e}"),
_ => tracing::error!("failed to run test: {e}\nretry after {delay:?}"),
}
}
Err(e) if i >= 5 => panic!("failed to run test after retry {i} times: {e}"),
Err(e) => tracing::error!("failed to run test: {e}\nretry after {delay:?}"),
}
tokio::time::sleep(delay).await;
}
Expand Down

0 comments on commit d45042c

Please sign in to comment.