Skip to content

Commit d51b727

Browse files
authored
Fix test_wasm_end_to_end_allowances_fungible timing issue. (#4862)
## Motivation In #4834 a lot of tests were changed to wait for notifications instead of retrying in a loop. The `test_wasm_end_to_end_allowances_fungible` specifically creates multiple node services for the same chain. While service 1 has already used the chain, services 2 and 3 need to synchronize it. So we check the chain tip and if it is lower than the one seen by service 1, we wait for the corresponding notification. [In the ScyllaDB tests this panics](https://github.com/linera-io/linera-protocol/actions/runs/18822090732/job/53699169562), because we unwrap the chain tip, and it is `None` if the node service does not have any block yet. ## Proposal If it is `None`, also wait for the notification. ## Test Plan CI ## Release Plan - These changes should be backported to `testnet_conway`. ## Links - Problem introduced in #4834. - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
1 parent c2d6631 commit d51b727

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

linera-service/tests/linera_net_tests.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,10 +2059,18 @@ async fn test_wasm_end_to_end_allowances_fungible(config: impl LineraNetConfig)
20592059
let mut notifications3 = node_service3.notifications(chain2).await?;
20602060
// Wait until clients 2 and 3 see the initialized application state.
20612061
let (_, height) = node_service1.chain_tip(chain2).await?.unwrap();
2062-
if node_service2.chain_tip(chain2).await?.unwrap().1 < height {
2062+
if node_service2
2063+
.chain_tip(chain2)
2064+
.await?
2065+
.is_none_or(|(_, h)| h < height)
2066+
{
20632067
notifications2.wait_for_block(height).await?;
20642068
}
2065-
if node_service3.chain_tip(chain2).await?.unwrap().1 < height {
2069+
if node_service3
2070+
.chain_tip(chain2)
2071+
.await?
2072+
.is_none_or(|(_, h)| h < height)
2073+
{
20662074
notifications3.wait_for_block(height).await?;
20672075
}
20682076

0 commit comments

Comments
 (0)