Skip to content

Commit

Permalink
tests: add storage nodes restart to payment tests (#836)
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-khimov authored Aug 16, 2024
2 parents 1bc85c2 + bfd121e commit 4f0c310
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions neofs-testlib/neofs_testlib/env/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,7 @@ def start(self, fresh=True):
def stop(self):
logger.info(f"Stopping Storage Node:{self}")
self.process.terminate()
self.process.wait()

@allure.step("Kill storage node")
def kill(self):
Expand Down
2 changes: 1 addition & 1 deletion pytest_tests/lib/helpers/node_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def start_storage_nodes(nodes: list[StorageNode]) -> None:
"""
start_threads = []
for node in nodes:
start_threads.append(threading.Thread(target=node._launch_process))
start_threads.append(threading.Thread(target=node.start, kwargs={"fresh": False}))
for t in start_threads:
t.start()
for t in start_threads:
Expand Down
4 changes: 4 additions & 0 deletions pytest_tests/tests/payment/test_container_payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from helpers.container import create_container
from helpers.file_helper import generate_file
from helpers.neofs_verbs import put_object
from helpers.node_management import restart_storage_nodes
from helpers.wallet_helpers import get_neofs_balance, get_wallet_balance
from neofs_testlib.env.env import NeoFSEnv, NodeWallet
from neofs_testlib.utils import wallet as wallet_utils
Expand Down Expand Up @@ -107,6 +108,9 @@ def test_container_payments(
post_data=f"MaxObjectSize={MAX_OBJECT_SIZE} ContainerFee={CONTAINER_FEE} BasicIncomeRate={STORAGE_FEE} EpochDuration={EPOCH_DURATION}",
)

# Temporary workaround for a problem with propagading MaxObjectSize between storage nodes
restart_storage_nodes(neofs_env.storage_nodes)

objects_count = int(GB / MAX_OBJECT_SIZE) * objects_count_multiplier

with allure.step("Create container and validate that a user was charged with the required amount of GAS"):
Expand Down

0 comments on commit 4f0c310

Please sign in to comment.