forked from TrueCloudLab/frostfs-testcases
[#280] Update verify object func
Signed-off-by: Dmitriy Zayakin <d.zayakin@yadro.com>
This commit is contained in:
parent
626409af78
commit
5c35e9bb81
1 changed files with 8 additions and 10 deletions
|
@ -1,5 +1,6 @@
|
||||||
import itertools
|
import itertools
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
import random
|
import random
|
||||||
|
|
||||||
import allure
|
import allure
|
||||||
|
@ -15,7 +16,7 @@ from frostfs_testlib.storage.dataclasses.object_size import ObjectSize
|
||||||
from frostfs_testlib.storage.dataclasses.storage_object_info import StorageObjectInfo
|
from frostfs_testlib.storage.dataclasses.storage_object_info import StorageObjectInfo
|
||||||
from frostfs_testlib.storage.dataclasses.wallet import WalletInfo
|
from frostfs_testlib.storage.dataclasses.wallet import WalletInfo
|
||||||
from frostfs_testlib.testing.cluster_test_base import ClusterTestBase
|
from frostfs_testlib.testing.cluster_test_base import ClusterTestBase
|
||||||
from frostfs_testlib.testing.parallel import parallel
|
from frostfs_testlib.testing.parallel import parallel, parallel_workers_limit
|
||||||
from frostfs_testlib.testing.test_control import wait_for_success
|
from frostfs_testlib.testing.test_control import wait_for_success
|
||||||
from frostfs_testlib.utils.file_utils import get_file_hash
|
from frostfs_testlib.utils.file_utils import get_file_hash
|
||||||
from pytest import FixtureRequest
|
from pytest import FixtureRequest
|
||||||
|
@ -55,8 +56,7 @@ class TestFailoverServer(ClusterTestBase):
|
||||||
)
|
)
|
||||||
|
|
||||||
containers = [
|
containers = [
|
||||||
StorageContainer(StorageContainerInfo(result.result(), default_wallet), self.shell, self.cluster)
|
StorageContainer(StorageContainerInfo(result.result(), default_wallet), self.shell, self.cluster) for result in results
|
||||||
for result in results
|
|
||||||
]
|
]
|
||||||
|
|
||||||
return containers
|
return containers
|
||||||
|
@ -102,9 +102,7 @@ class TestFailoverServer(ClusterTestBase):
|
||||||
|
|
||||||
@allure.title("[Test] Create objects and get nodes with object")
|
@allure.title("[Test] Create objects and get nodes with object")
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
def object_and_nodes(
|
def object_and_nodes(self, simple_object_size: ObjectSize, container: StorageContainer) -> tuple[StorageObjectInfo, list[ClusterNode]]:
|
||||||
self, simple_object_size: ObjectSize, container: StorageContainer
|
|
||||||
) -> tuple[StorageObjectInfo, list[ClusterNode]]:
|
|
||||||
object_info = container.generate_object(simple_object_size.value)
|
object_info = container.generate_object(simple_object_size.value)
|
||||||
object_nodes = get_object_nodes(self.cluster, object_info.cid, object_info.oid, self.cluster.cluster_nodes[0])
|
object_nodes = get_object_nodes(self.cluster, object_info.cid, object_info.oid, self.cluster.cluster_nodes[0])
|
||||||
return object_info, object_nodes
|
return object_info, object_nodes
|
||||||
|
@ -124,6 +122,8 @@ class TestFailoverServer(ClusterTestBase):
|
||||||
|
|
||||||
@reporter.step("Verify objects")
|
@reporter.step("Verify objects")
|
||||||
def verify_objects(self, nodes: list[StorageNode], storage_objects: list[StorageObjectInfo]) -> None:
|
def verify_objects(self, nodes: list[StorageNode], storage_objects: list[StorageObjectInfo]) -> None:
|
||||||
|
workers_count = os.environ.get("PARALLEL_CUSTOM_LIMIT", 50)
|
||||||
|
with parallel_workers_limit(workers_count):
|
||||||
parallel(self._verify_object, storage_objects * len(nodes), node=itertools.cycle(nodes))
|
parallel(self._verify_object, storage_objects * len(nodes), node=itertools.cycle(nodes))
|
||||||
|
|
||||||
@allure.title("Full shutdown node")
|
@allure.title("Full shutdown node")
|
||||||
|
@ -200,9 +200,7 @@ class TestFailoverServer(ClusterTestBase):
|
||||||
simple_file: str,
|
simple_file: str,
|
||||||
):
|
):
|
||||||
object_info, object_nodes = object_and_nodes
|
object_info, object_nodes = object_and_nodes
|
||||||
endpoint_without_object = list(set(self.cluster.cluster_nodes) - set(object_nodes))[
|
endpoint_without_object = list(set(self.cluster.cluster_nodes) - set(object_nodes))[0].storage_node.get_rpc_endpoint()
|
||||||
0
|
|
||||||
].storage_node.get_rpc_endpoint()
|
|
||||||
endpoint_with_object = object_nodes[0].storage_node.get_rpc_endpoint()
|
endpoint_with_object = object_nodes[0].storage_node.get_rpc_endpoint()
|
||||||
|
|
||||||
with reporter.step("Stop all nodes with object except first one"):
|
with reporter.step("Stop all nodes with object except first one"):
|
||||||
|
|
Loading…
Reference in a new issue