From 0ca45d1ba80eedbfc1f6cd3c5a87dd10c7540b03 Mon Sep 17 00:00:00 2001 From: Vladimir Domnich Date: Mon, 15 Aug 2022 11:21:23 -0400 Subject: [PATCH] Rename variable for GC waiting We need just an aggregate variable that allows to wait until GC pass occurs on a storage node, rather than a variable for specific shard. Also, we need to account for a time that GC session itself takes. Signed-off-by: Vladimir Domnich --- pytest_tests/helpers/utility.py | 4 ++-- pytest_tests/testsuites/network/test_node_management.py | 4 ++-- robot/variables/common.py | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pytest_tests/helpers/utility.py b/pytest_tests/helpers/utility.py index 4744ecc..1b33760 100644 --- a/pytest_tests/helpers/utility.py +++ b/pytest_tests/helpers/utility.py @@ -4,7 +4,7 @@ import uuid import allure -from common import ASSETS_DIR, SIMPLE_OBJ_SIZE, SHARD_0_GC_SLEEP +from common import ASSETS_DIR, SIMPLE_OBJ_SIZE, STORAGE_GC_TIME def create_file_with_content(file_path: str = None, content: str = None) -> str: @@ -90,6 +90,6 @@ def placement_policy_from_container(container_info: str) -> str: def wait_for_gc_pass_on_storage_nodes() -> None: # We add 15 seconds to allow some time for GC process itself - wait_time = robot_time_to_int(SHARD_0_GC_SLEEP) + 15 + wait_time = robot_time_to_int(STORAGE_GC_TIME) with allure.step(f'Wait {wait_time}s until GC completes on storage nodes'): time.sleep(wait_time) diff --git a/pytest_tests/testsuites/network/test_node_management.py b/pytest_tests/testsuites/network/test_node_management.py index 6a252c7..08a5e47 100644 --- a/pytest_tests/testsuites/network/test_node_management.py +++ b/pytest_tests/testsuites/network/test_node_management.py @@ -79,9 +79,9 @@ def return_nodes(alive_node: str = None): with allure.step(f'Start node {node}'): helper.start_node(node) - # Wait for node to receive notifications from morph-chain + # 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)) - tick_epoch() with allure.step(f'Move node {node} to online state'): node_set_status(node, status='online', retries=2) diff --git a/robot/variables/common.py b/robot/variables/common.py index a909fc6..2d4d61d 100644 --- a/robot/variables/common.py +++ b/robot/variables/common.py @@ -13,9 +13,9 @@ MAINNET_TIMEOUT = os.getenv('MAINNET_TIMEOUT', "1min") MORPH_BLOCK_TIME = os.getenv("MORPH_BLOCK_TIME", '1s') NEOFS_CONTRACT_CACHE_TIMEOUT = os.getenv("NEOFS_CONTRACT_CACHE_TIMEOUT", "30s") -# TODO: change to NEOFS_STORAGE_DEFAULT_GC_REMOVER_SLEEP_INTERVAL - -SHARD_0_GC_SLEEP = os.getenv("NEOFS_STORAGE_SHARD_0_GC_REMOVER_SLEEP_INTERVAL", "1m") +# Time interval that allows a GC pass on storage node (this includes GC sleep interval +# of 1min plus 15 seconds for GC pass itself) +STORAGE_GC_TIME = os.getenv("STORAGE_GC_TIME", "75s") NEOFS_ENDPOINT = os.getenv("NEOFS_ENDPOINT", "s01.neofs.devenv:8080")