Revision 8bdd9b6795f6a78ffca1f4e0649531d71fa51f88 authored by Marge Bot on 13 September 2022, 10:56:47 UTC, committed by Marge Bot on 13 September 2022, 10:56:47 UTC
Co-authored-by: Ole Krüger <ole.kruger@trili.tech> Approved-by: Swann Moreau <evertedsphere@gmail.com> Approved-by: Emma Turner <1623821-emturner@users.noreply.gitlab.com> Approved-by: Nicolas Ayache <nicolas.ayache@nomadic-labs.com> Approved-by: Andrea Cerone <andrea.cerone@trili.tech> See merge request https://gitlab.com/tezos/tezos/-/merge_requests/6285
test_many_bakers.py
import time
import pytest
from tools import utils, constants
from launchers.sandbox import Sandbox
from . import protocol
# TODO parameterize test
MINIMAL_BLOCK_DELAY = 15
@pytest.mark.baker
@pytest.mark.multinode
@pytest.mark.slow
@pytest.mark.incremental
class TestManyBakers:
"""Run 5 bakers and num nodes, wait and check logs"""
def test_init(self, sandbox: Sandbox):
for i in range(10):
sandbox.add_node(i, params=constants.NODE_PARAMS)
protocol.activate(sandbox.client(0))
for i in range(5):
sandbox.add_baker(
i,
[f'bootstrap{i + 1}'],
proto=protocol.DAEMON,
run_params=['--liquidity-baking-toggle-vote', 'pass'],
)
def test_wait(self):
# expects two level to be added to level start
time.sleep(2 * MINIMAL_BLOCK_DELAY)
def test_progress(self, sandbox: Sandbox):
min_level = min(
[client.get_level() for client in sandbox.all_clients()]
)
assert min_level >= 3
@pytest.mark.xfail
def test_check_logs(self, sandbox: Sandbox):
if not sandbox.log_dir:
pytest.skip()
assert sandbox.logs
error_pattern = r"canceled|crashed"
assert utils.check_logs(sandbox.logs, error_pattern)
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...