Skip to content

Commit

Permalink
Adjust zombienet test resources and logic (#4032)
Browse files Browse the repository at this point in the history
One more try to make this test robust from a resource perspective.

---------

Signed-off-by: Andrei Sandu <[email protected]>
Co-authored-by: Javier Viola <[email protected]>
  • Loading branch information
sandreim and pepoviola authored Apr 12, 2024
1 parent b2fc4ab commit efed86a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .gitlab/pipeline/zombienet/polkadot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ zombienet-polkadot-functional-0011-async-backing-6-seconds-rate:
zombienet-polkadot-elastic-scaling-0001-basic-3cores-6s-blocks:
extends:
- .zombienet-polkadot-common
variables:
FORCED_INFRA_INSTANCE: "spot-iops"
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--local-dir="${LOCAL_DIR}/elastic_scaling"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ chain = "rococo-local"
default_command = "polkadot"

[relaychain.default_resources]
limits = { memory = "4G", cpu = "2" }
requests = { memory = "2G", cpu = "1" }
limits = { memory = "4G", cpu = "3" }
requests = { memory = "4G", cpu = "3" }

[[relaychain.node_groups]]
name = "elastic-validator"
Expand All @@ -32,11 +32,20 @@ default_command = "polkadot"
[[parachains]]
id = {{id}}
addToGenesis = true
[parachains.default_resources]
limits = { memory = "4G", cpu = "3" }
requests = { memory = "4G", cpu = "3" }

[parachains.collator]
name = "some-parachain"
image = "{{COL_IMAGE}}"
command = "adder-collator"
args = ["-lparachain::collation-generation=trace,parachain::collator-protocol=trace,parachain=debug"]

{% endfor %}

# This represents the layout of the adder collator block header.
[types.Header]
number = "u64"
parent_hash = "Hash"
post_state = "Hash"
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ elastic-validator-0: js-script ./assign-core.js with "2000,1" return is 0 within
elastic-validator-0: reports substrate_block_height{status="best"} is at least 20 within 600 seconds

# Non elastic parachain should progress normally
some-parachain-1: count of log lines containing "Parachain velocity: 1" is at least 9 within 20 seconds
some-parachain-1: count of log lines containing "Parachain velocity: 1" is at least 5 within 20 seconds
# Sanity
some-parachain-1: count of log lines containing "Parachain velocity: 2" is 0 within 20 seconds
some-parachain-1: count of log lines containing "Parachain velocity: 2" is 0

# Parachain should progress 3 blocks per relay chain block ideally, however this measurement does
# `ceil()` on the actual velocity to account for CI overload.
some-parachain: count of log lines containing "Parachain velocity: 3" is at least 9 within 20 seconds
# Parachain should progress 3 blocks per relay chain block ideally, however CI might not be
# the most performant environment so we'd just use a lower bound of 2 blocks per RCB
elastic-validator-0: parachain 2000 block height is at least 20 within 200 seconds

6 changes: 2 additions & 4 deletions polkadot/zombienet_tests/elastic_scaling/assign-core.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
async function run(nodeName, networkInfo, args) {
const { wsUri, userDefinedTypes } = networkInfo.nodesByName[nodeName];
const api = await zombie.connect(wsUri, userDefinedTypes);
const wsUri = networkInfo.nodesByName[nodeName].wsUri;
const api = await zombie.connect(wsUri);

let para = Number(args[0]);
let core = Number(args[1]);
Expand Down Expand Up @@ -33,8 +33,6 @@ async function run(nodeName, networkInfo, args) {
});
});



return 0;
}

Expand Down

0 comments on commit efed86a

Please sign in to comment.