From 856e5afa6055e78ec8f8907dbc24aedca7383ef1 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Fri, 12 May 2023 18:13:14 +0300 Subject: [PATCH] [#41] lifetime: Fix lifetime test Signed-off-by: Dmitrii Stepanov --- .../testsuites/object/test_object_lifetime.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pytest_tests/testsuites/object/test_object_lifetime.py b/pytest_tests/testsuites/object/test_object_lifetime.py index be35cfae..bf04eaf2 100644 --- a/pytest_tests/testsuites/object/test_object_lifetime.py +++ b/pytest_tests/testsuites/object/test_object_lifetime.py @@ -4,7 +4,7 @@ import allure import pytest from frostfs_testlib.resources.error_patterns import OBJECT_NOT_FOUND from frostfs_testlib.steps.cli.container import create_container -from frostfs_testlib.steps.cli.object import get_object_from_random_node, put_object_to_random_node +from frostfs_testlib.steps.cli.object import get_object_from_random_node, put_object_to_random_node, head_object from frostfs_testlib.steps.epoch import get_epoch from frostfs_testlib.testing.cluster_test_base import ClusterTestBase from frostfs_testlib.utils.file_utils import generate_file, get_file_hash @@ -54,6 +54,19 @@ class TestObjectApiLifetime(ClusterTestBase): # Wait for GC, because object with expiration is counted as alive until GC removes it wait_for_gc_pass_on_storage_nodes() - with allure.step("Check object deleted because it expires-on epoch"): + with allure.step("Check object deleted because it expires on epoch"): + with pytest.raises(Exception, match=OBJECT_NOT_FOUND): + head_object(wallet, cid, oid, self.shell, self.cluster.default_rpc_endpoint) + with pytest.raises(Exception, match=OBJECT_NOT_FOUND): + get_object_from_random_node(wallet, cid, oid, self.shell, self.cluster) + + with allure.step("Tick additional epoch"): + self.tick_epoch() + + wait_for_gc_pass_on_storage_nodes() + + with allure.step("Check object deleted because it expires on previous epoch"): + with pytest.raises(Exception, match=OBJECT_NOT_FOUND): + head_object(wallet, cid, oid, self.shell, self.cluster.default_rpc_endpoint) with pytest.raises(Exception, match=OBJECT_NOT_FOUND): get_object_from_random_node(wallet, cid, oid, self.shell, self.cluster)