Change sleeps from MAINNET_BLOCK_TIME to MORPH_BLOCK_TIME

Our tests sleeps should based on MORPH_BLOCK_TIME

Signed-off-by: anikeev-yadro <a.anikeev@yadro.com>
This commit is contained in:
anikeev-yadro 2022-09-19 16:37:45 +03:00 committed by anikeev-yadro
parent 467349fc68
commit 9eb33465f9
2 changed files with 9 additions and 9 deletions

View file

@ -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'):

View file

@ -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)