Skip to content

Commit b9b94c5

Browse files
authored
Fix faucet timeout in long faucet chain test (#2721)
* Add `forget_chain` method to wallet CLI wrapper Allow removing chains from the wallet in tests. * Forget irrelevant newly created chains in test The chains only serve to increase the Faucet chain's length in a way that simulates the Faucet from being executed for a long time, so they can be forgotten after they have been created.
1 parent a0003ce commit b9b94c5

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

linera-service/src/cli_wrappers/wallet.rs

+10
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,16 @@ impl ClientWrapper {
709709
Ok(())
710710
}
711711

712+
/// Runs `linera wallet forget-chain CHAIN_ID`.
713+
pub async fn forget_chain(&self, chain_id: ChainId) -> Result<()> {
714+
let mut command = self.command().await?;
715+
command
716+
.args(["wallet", "forget-chain"])
717+
.arg(chain_id.to_string());
718+
command.spawn_and_wait_for_stdout().await?;
719+
Ok(())
720+
}
721+
712722
pub async fn retry_pending_block(
713723
&self,
714724
chain_id: Option<ChainId>,

linera-service/tests/linera_net_tests.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2867,9 +2867,10 @@ async fn test_end_to_end_faucet_with_long_chains(config: impl LineraNetConfig) -
28672867

28682868
// Use the faucet directly to initialize many chains
28692869
for _ in 0..chain_count {
2870-
faucet_client
2870+
let (_, new_chain_id) = faucet_client
28712871
.open_chain(faucet_chain, None, Amount::ONE)
28722872
.await?;
2873+
faucet_client.forget_chain(new_chain_id).await?;
28732874
}
28742875

28752876
let amount = Amount::ONE;

0 commit comments

Comments
 (0)