From 9eb33465f9dc1fc1fda92cbb29775d95cb14e9bb Mon Sep 17 00:00:00 2001 From: anikeev-yadro Date: Mon, 19 Sep 2022 16:37:45 +0300 Subject: [PATCH] Change sleeps from MAINNET_BLOCK_TIME to MORPH_BLOCK_TIME Our tests sleeps should based on MORPH_BLOCK_TIME Signed-off-by: anikeev-yadro --- .../testsuites/network/test_node_management.py | 10 +++++----- robot/resources/lib/python_keywords/node_management.py | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pytest_tests/testsuites/network/test_node_management.py b/pytest_tests/testsuites/network/test_node_management.py index c1e9de8..139256d 100644 --- a/pytest_tests/testsuites/network/test_node_management.py +++ b/pytest_tests/testsuites/network/test_node_management.py @@ -5,7 +5,7 @@ from time import sleep import allure import pytest from data_formatters import get_wallet_public_key -from common import (COMPLEX_OBJ_SIZE, MAINNET_BLOCK_TIME, NEOFS_CONTRACT_CACHE_TIMEOUT, +from common import (COMPLEX_OBJ_SIZE, MAINNET_BLOCK_TIME, MORPH_BLOCK_TIME, NEOFS_CONTRACT_CACHE_TIMEOUT, NEOFS_NETMAP_DICT, STORAGE_RPC_ENDPOINT_1, STORAGE_WALLET_PASS) from epoch import tick_epoch from grpc_responses import OBJECT_NOT_FOUND, error_matches_status @@ -81,13 +81,13 @@ def return_nodes(alive_node: str = None): # We need to wait for node to establish notifications from morph-chain # Otherwise it will hang up when we will try to set status - sleep(robot_time_to_int(MAINNET_BLOCK_TIME)) + sleep(robot_time_to_int(MORPH_BLOCK_TIME)) with allure.step(f'Move node {node} to online state'): node_set_status(node, status='online', retries=2) check_nodes.remove(node) - sleep(robot_time_to_int(MAINNET_BLOCK_TIME)) + sleep(robot_time_to_int(MORPH_BLOCK_TIME)) for __attempt in range(3): try: tick_epoch() @@ -170,7 +170,7 @@ def test_nodes_management(prepare_tmp_dir): with allure.step(f'Move node {random_node} to offline state'): node_set_status(random_node, status='offline') - sleep(robot_time_to_int(MAINNET_BLOCK_TIME)) + sleep(robot_time_to_int(MORPH_BLOCK_TIME)) tick_epoch() with allure.step(f'Check node {random_node} went to offline'): @@ -182,7 +182,7 @@ def test_nodes_management(prepare_tmp_dir): with allure.step(f'Check node {random_node} went to online'): node_set_status(random_node, status='online') - sleep(robot_time_to_int(MAINNET_BLOCK_TIME)) + sleep(robot_time_to_int(MORPH_BLOCK_TIME)) tick_epoch() with allure.step(f'Check node {random_node} went to online'): diff --git a/robot/resources/lib/python_keywords/node_management.py b/robot/resources/lib/python_keywords/node_management.py index 1232277..24b0a53 100644 --- a/robot/resources/lib/python_keywords/node_management.py +++ b/robot/resources/lib/python_keywords/node_management.py @@ -10,7 +10,7 @@ import time from dataclasses import dataclass from typing import Optional -from common import MAINNET_BLOCK_TIME, NEOFS_NETMAP_DICT, STORAGE_WALLET_PASS +from common import MAINNET_BLOCK_TIME, MORPH_BLOCK_TIME, NEOFS_NETMAP_DICT, STORAGE_WALLET_PASS from data_formatters import get_wallet_public_key from epoch import tick_epoch from robot.api import logger @@ -193,7 +193,7 @@ def delete_node_data(node_name: str) -> None: helper = get_storage_service_helper() helper.stop_node(node_name) helper.delete_node_data(node_name) - time.sleep(robot_time_to_int(MAINNET_BLOCK_TIME)) + time.sleep(robot_time_to_int(MORPH_BLOCK_TIME)) @keyword('Exclude node {node_to_include} from network map') @@ -207,7 +207,7 @@ def exclude_node_from_network_map(node_to_exclude, alive_node): node_set_status(node_to_exclude, status='offline') - time.sleep(robot_time_to_int(MAINNET_BLOCK_TIME)) + time.sleep(robot_time_to_int(MORPH_BLOCK_TIME)) tick_epoch() snapshot = get_netmap_snapshot(node_name=alive_node) @@ -218,7 +218,7 @@ def exclude_node_from_network_map(node_to_exclude, alive_node): def include_node_to_network_map(node_to_include: str, alive_node: str) -> None: node_set_status(node_to_include, status='online') - time.sleep(robot_time_to_int(MAINNET_BLOCK_TIME)) + time.sleep(robot_time_to_int(MORPH_BLOCK_TIME)) tick_epoch() check_node_in_map(node_to_include, alive_node)