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

fix: shutdown cluster test timeout #918

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
19 changes: 17 additions & 2 deletions crates/curp/tests/it/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,23 @@ async fn shutdown_rpc_should_shutdown_the_cluster() {
for i in 0..10 {
let cmd = TestCommand::new_put(vec![i], i);
let res = req_client.propose(&cmd, None, true).await;
if res.is_ok() && res.unwrap().is_ok() {
collection.push(i);
match res {
Ok(res) => {
if res.is_ok() {
collection.push(i);
}
}
Err(err) => {
// retry 3 times after 10.5s, the cluster has been shutted down
if err.code() == tonic::Code::DeadlineExceeded
|| matches!(
err.into(),
CurpError::ShuttingDown(_) | CurpError::RpcTransport(())
)
{
return collection;
}
}
}
}
collection
Expand Down
Loading