Skip to content

Commit

Permalink
remove intermittent asserts in test (#7600)
Browse files Browse the repository at this point in the history
  • Loading branch information
oxarbitrage authored Sep 21, 2023
1 parent d651ee3 commit 09c1f99
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions zebrad/tests/common/lightwalletd/send_transaction_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ pub async fn run() -> Result<()> {
zebrad.expect_stdout_line_matches("answered mempool request .*req.*=.*TransactionIds")?;

// GetMempoolTx: make sure at least one of the transactions were inserted into the mempool.
let mut counter = 0;
let mut _counter = 0;
while let Some(tx) = transactions_stream.message().await? {
let hash: [u8; 32] = tx.hash.clone().try_into().expect("hash is correct length");
let hash = transaction::Hash::from_bytes_in_display_order(&hash);
Expand All @@ -202,39 +202,32 @@ pub async fn run() -> Result<()> {
in isolated mempool: {tx:?}",
);

counter += 1;
_counter += 1;
}

// TODO: This test is working locally in some environments, failing in others, failing always in the CI.
// TODO: This check sometimes works and sometimes it doesn't so we can't just enable it.
// https://github.com/ZcashFoundation/zebra/issues/7529
//assert!(
// counter >= 1,
// "all transactions from future blocks failed to send to an isolated mempool"
//);
assert_eq!(
counter, 0,
"developers: should fail if `get_mempool_tx` start working."
);

// GetMempoolTx: make sure at least one of the transactions were inserted into the mempool.
tracing::info!("calling GetMempoolStream gRPC to fetch transactions...");
let mut transaction_stream = rpc_client.get_mempool_stream(Empty {}).await?.into_inner();

let mut counter = 0;
let mut _counter = 0;
while let Some(_tx) = transaction_stream.message().await? {
// TODO: check tx.data or tx.height here?
counter += 1;
_counter += 1;
}

// TODO: This is not working, found out why.
// TODO: This check sometimes works and sometimes it doesn't so we can't just enable it.
// https://github.com/ZcashFoundation/zebra/issues/7529
//assert!(
// counter >= 1,
// "all transactions from future blocks failed to send to an isolated mempool"
//);
assert_eq!(
counter, 0,
"developers: should fail if `get_mempool_stream` start working."
);

Ok(())
}
Expand Down

0 comments on commit 09c1f99

Please sign in to comment.