From cba7d13bc7d132fe758b859393bca7ddd45c690f Mon Sep 17 00:00:00 2001
From: Serban Iorga <serban@parity.io>
Date: Thu, 10 Oct 2024 12:47:29 +0300
Subject: [PATCH] Fix `0003-beefy-and-mmr` test (#6003)

Resolves https://github.com/paritytech/polkadot-sdk/issues/5972

Only needed to increase some timeouts
---
 .gitlab/pipeline/zombienet/polkadot.yml          | 12 ++++++------
 .../functional/0003-beefy-and-mmr.zndsl          | 16 ++++++++--------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/.gitlab/pipeline/zombienet/polkadot.yml b/.gitlab/pipeline/zombienet/polkadot.yml
index 33191d99941..d1738083994 100644
--- a/.gitlab/pipeline/zombienet/polkadot.yml
+++ b/.gitlab/pipeline/zombienet/polkadot.yml
@@ -94,7 +94,7 @@ zombienet-polkadot-functional-0002-parachains-disputes:
       --local-dir="${LOCAL_DIR}/functional"
       --test="0002-parachains-disputes.zndsl"
 
-.zombienet-polkadot-functional-0003-beefy-and-mmr:
+zombienet-polkadot-functional-0003-beefy-and-mmr:
   extends:
     - .zombienet-polkadot-common
   script:
@@ -172,7 +172,7 @@ zombienet-polkadot-elastic-scaling-0001-basic-3cores-6s-blocks:
   variables:
     FORCED_INFRA_INSTANCE: "spot-iops"
   before_script:
-    - !reference [.zombienet-polkadot-common, before_script]
+    - !reference [ .zombienet-polkadot-common, before_script ]
     - cp --remove-destination ${LOCAL_DIR}/assign-core.js ${LOCAL_DIR}/elastic_scaling
   script:
     - /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
@@ -183,7 +183,7 @@ zombienet-polkadot-elastic-scaling-0002-elastic-scaling-doesnt-break-parachains:
   extends:
     - .zombienet-polkadot-common
   before_script:
-    - !reference [.zombienet-polkadot-common, before_script]
+    - !reference [ .zombienet-polkadot-common, before_script ]
     - cp --remove-destination ${LOCAL_DIR}/assign-core.js ${LOCAL_DIR}/elastic_scaling
   script:
     - /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
@@ -218,7 +218,7 @@ zombienet-polkadot-functional-0015-coretime-shared-core:
   extends:
     - .zombienet-polkadot-common
   before_script:
-    - !reference [.zombienet-polkadot-common, before_script]
+    - !reference [ .zombienet-polkadot-common, before_script ]
     - cp --remove-destination ${LOCAL_DIR}/assign-core.js ${LOCAL_DIR}/functional
   script:
     - /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
@@ -360,10 +360,10 @@ zombienet-polkadot-malus-0001-dispute-valid:
     - job: build-polkadot-zombienet-tests
       artifacts: true
   before_script:
-    - !reference [".zombienet-polkadot-common", "before_script"]
+    - !reference [ ".zombienet-polkadot-common", "before_script" ]
     - export POLKADOT_IMAGE="${ZOMBIENET_INTEGRATION_TEST_IMAGE}"
   script:
-  # we want to use `--no-capture` in zombienet tests.
+    # we want to use `--no-capture` in zombienet tests.
     - unset NEXTEST_FAILURE_OUTPUT
     - unset NEXTEST_SUCCESS_OUTPUT
     - cargo nextest run --archive-file ./artifacts/polkadot-zombienet-tests.tar.zst --no-capture -- smoke::coretime_revenue::coretime_revenue_test
diff --git a/polkadot/zombienet_tests/functional/0003-beefy-and-mmr.zndsl b/polkadot/zombienet_tests/functional/0003-beefy-and-mmr.zndsl
index 8300ef051f0..4fc066a13b0 100644
--- a/polkadot/zombienet_tests/functional/0003-beefy-and-mmr.zndsl
+++ b/polkadot/zombienet_tests/functional/0003-beefy-and-mmr.zndsl
@@ -18,22 +18,22 @@ validator-unstable: reports substrate_beefy_best_block is at least 1 within 60 s
 validator-unstable: pause
 
 # Verify validator sets get changed on new sessions.
-validator: reports substrate_beefy_validator_set_id is at least 1 within 70 seconds
+validator: reports substrate_beefy_validator_set_id is at least 1 within 180 seconds
 # Check next session too.
-validator: reports substrate_beefy_validator_set_id is at least 2 within 130 seconds
+validator: reports substrate_beefy_validator_set_id is at least 2 within 180 seconds
 
 # Verify voting happens and blocks are being finalized for new sessions too:
 # since we verified we're at least in the 3rd session, verify BEEFY finalized mandatory #21.
-validator: reports substrate_beefy_best_block is at least 21 within 130 seconds
+validator: reports substrate_beefy_best_block is at least 21 within 180 seconds
 
 # Custom JS to test BEEFY RPCs.
-validator-0: js-script ./0003-beefy-finalized-heads.js with "validator-0,validator-1,validator-2" return is 1 within 5 seconds
+validator-0: js-script ./0003-beefy-finalized-heads.js with "validator-0,validator-1,validator-2" return is 1 within 60 seconds
 
 # Custom JS to test MMR RPCs.
-validator: js-script ./0003-mmr-leaves.js with "21" return is 1 within 5 seconds
-validator: js-script ./0003-mmr-generate-and-verify-proof.js with "validator-0,validator-1,validator-2" return is 1 within 5 seconds
+validator: js-script ./0003-mmr-leaves.js with "21" return is 1 within 60 seconds
+validator: js-script ./0003-mmr-generate-and-verify-proof.js with "validator-0,validator-1,validator-2" return is 1 within 60 seconds
 
 # Resume validator-unstable and verify it imports all BEEFY justification and catches up.
 validator-unstable: resume
-validator-unstable: reports substrate_beefy_validator_set_id is at least 2 within 30 seconds
-validator-unstable: reports substrate_beefy_best_block is at least 21 within 30 seconds
+validator-unstable: reports substrate_beefy_validator_set_id is at least 2 within 60 seconds
+validator-unstable: reports substrate_beefy_best_block is at least 21 within 60 seconds
-- 
GitLab