Skip to content

Commit

Permalink
wip4
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejnems committed Feb 8, 2023
1 parent c8e9e67 commit 45b2e45
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 36 deletions.
30 changes: 4 additions & 26 deletions .github/workflows/e2e-tests-main-devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,9 @@ jobs:
name: Test multiple restarts
runs-on: ubuntu-20.04
needs: build-new-node
strategy:
matrix:
pruning: ['', '--state-pruning 2048']
steps:
- name: Checkout source code
uses: actions/checkout@v2
Expand All @@ -843,32 +846,7 @@ jobs:
env:
# Relative to local-tests/ directory
ALEPH_NODE_BINARY: aleph-release-node/aleph-node
run: ./.github/scripts/test_multiple_restarts.sh

test-multiple-restarts-pruning:
name: Test multiple restarts
runs-on: ubuntu-20.04
needs: build-new-node
steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Download all artifacts
uses: actions/download-artifact@v2
with:
path: local-tests/

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Test multiple restarts
timeout-minutes: 10
env:
# Relative to local-tests/ directory
ALEPH_NODE_BINARY: aleph-release-node/aleph-node
run: ./.github/scripts/test_multiple_restarts.sh --state-pruning 2048
run: ./.github/scripts/test_multiple_restarts.sh ${{ matrix.pruning }}

check-runtime-change:
name: Inspect whether runtime version has been changed (compared with main)
Expand Down
12 changes: 6 additions & 6 deletions local-tests/test_catch_up.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

from chainrunner import Chain, Seq, generate_keys, check_finalized

argParser = argparse.ArgumentParser()
argParser.add_argument("--state-pruning", help="state pruning argument")
state_pruning = argParser.parse_args().state_pruning


def printt(s): print(ctime() + ' | ' + s)


argParser = argparse.ArgumentParser()
argParser.add_argument("--state-pruning", help="state pruning argument")
state_pruning = argParser.parse_args().state_pruning

# Path to working directory, where chainspec, logs and nodes' dbs are written:
workdir = abspath(os.getenv('WORKDIR', '/tmp/workdir'))
# Path to the aleph-node binary (important use short-session feature):
Expand Down Expand Up @@ -60,10 +60,10 @@ def printt(s): print(ctime() + ' | ' + s)

chain.start('aleph', nodes=[4, 5])

printt('Waiting for finalization')
chain.wait_for_finalization(0)
printt('Waiting for authorities')
chain.wait_for_authorities()
printt('Waiting for finalization')
chain.wait_for_finalization(90)

printt('Killing one validator and one nonvalidator')
chain.stop(nodes=[3, 4])
Expand Down
11 changes: 7 additions & 4 deletions local-tests/test_multiple_restarts.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def printt(s): print(ctime() + ' | ' + s)
sudo_account_id=keys[phrases[0]],
chain_type='local')

printt('Purging previous chain')
chain.purge()

chain.set_flags('no-mdns',
port=Seq(30334),
validator_port=Seq(30343),
Expand All @@ -51,10 +54,10 @@ def printt(s): print(ctime() + ' | ' + s)
printt('Starting the chain')
chain.start('aleph')

printt('Waiting for finalization')
chain.wait_for_finalization(0)
printt('Waiting for authorities')
chain.wait_for_authorities()
printt('Waiting for finalization')
chain.wait_for_finalization(256)

delta = 5

Expand All @@ -74,7 +77,7 @@ def printt(s): print(ctime() + ' | ' + s)
sys.exit(1)

printt('Restarting nodes')
chain[3].start('aleph')
chain.start('aleph', nodes=[3])

printt('Waiting for finalization')
chain.wait_for_finalization(finalized_before_start[3], nodes=[3])
Expand All @@ -84,5 +87,5 @@ def printt(s): print(ctime() + ' | ' + s)

# Check if the murdered node started catching up with reasonable nr of blocks.
if diff <= delta:
printt(f'Too small catch up for validators: {validator_diff}')
printt(f'Too small catch up for validators: {diff}')
sys.exit(1)

0 comments on commit 45b2e45

Please sign in to comment.