Skip to content

Commit

Permalink
Filter out connection failures (MystenLabs#1896)
Browse files Browse the repository at this point in the history
Filter out connection failures in shared object tests
  • Loading branch information
asonnino authored May 11, 2022
1 parent f766470 commit 541fdce
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 48 deletions.
80 changes: 39 additions & 41 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions sui/tests/shared_objects_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use sui::config::AuthorityInfo;
use sui_core::authority_client::{AuthorityAPI, NetworkAuthorityClient};
use sui_types::{
base_types::ObjectRef,
error::SuiResult,
error::{SuiError, SuiResult},
messages::{
CallArg, ConfirmationTransaction, ConsensusTransaction, ExecutionStatus, Transaction,
TransactionInfoResponse,
Expand Down Expand Up @@ -64,13 +64,15 @@ async fn submit_shared_object_transaction(
})
.collect();

let mut replies = Vec::new();
for result in futures::future::join_all(futures).await {
replies.push(Some(result))
}
if replies.iter().any(|x| x.is_some()) {
let replies: Vec<_> = futures::future::join_all(futures)
.await
.into_iter()
// Remove all `ConsensusConnectionBroken` replies.
break replies.into_iter().flatten().collect();
.filter(|result| !matches!(result, Err(SuiError::ConsensusConnectionBroken(..))))
.collect();

if !replies.is_empty() {
break replies;
}
}
}
Expand Down

0 comments on commit 541fdce

Please sign in to comment.