add 2 cases for test object lock #80

Merged
abereziny merged 1 commit from :feature-2 into master 2023-09-01 09:06:50 +00:00
Member
No description provided.
ChEktn requested review from abereziny 2023-08-14 14:23:09 +00:00
ChEktn requested review from qa-developers 2023-08-14 14:23:09 +00:00
ChEktn requested review from qa-committers 2023-08-14 14:23:11 +00:00
abereziny reviewed 2023-08-17 16:22:14 +00:00
@ -127,2 +127,4 @@
@wait_for_success(datetime_utils.parse_time(STORAGE_GC_TIME))
def check_object_not_found(wallet_file_path:str, cid: str, oid: str, shell: Shell, default_rpc_endpoint: str):
Member

can use StorageObjectInfo here instead of multiple single params
also default_rpc_endpoint should be just rpc_endpoint here

can use StorageObjectInfo here instead of multiple single params also `default_rpc_endpoint` should be just `rpc_endpoint` here
abereziny marked this conversation as resolved
abereziny reviewed 2023-08-17 16:23:39 +00:00
@ -659,2 +664,4 @@
self.cluster.default_rpc_endpoint,
)
@allure.title("Expired object should be removes after relocks")
Member

Expired object should be removed after all locks were expired

`Expired object should be removed after all locks were expired`
abereziny marked this conversation as resolved
abereziny reviewed 2023-08-17 16:24:15 +00:00
@ -661,0 +678,4 @@
):
allure.dynamic.title(
f"Expired object should be removes after relocks are expired for {request.node.callspec.id}"
Member

Same title correction :)

Same title correction :)
abereziny marked this conversation as resolved
abereziny reviewed 2023-08-17 16:27:59 +00:00
@ -661,0 +694,4 @@
expire_at=current_epoch + 3,
)
def check_lock_object(lock_object_id: str):
Member

We can move it near check_object_not_found (for better test readability)

Also, the logic can be made simplier

def verify_lock_available(lock_object_id: str):
      with expect_not_raises():
              head_object(
                            storage_object.wallet_file_path,
                            storage_object.cid,
                            lock_object_id,
                            self.shell,
                            self.cluster.default_rpc_endpoint,
                          )
We can move it near `check_object_not_found` (for better test readability) Also, the logic can be made simplier ``` def verify_lock_available(lock_object_id: str): with expect_not_raises(): head_object( storage_object.wallet_file_path, storage_object.cid, lock_object_id, self.shell, self.cluster.default_rpc_endpoint, ) ```
abereziny marked this conversation as resolved
abereziny reviewed 2023-08-17 16:29:14 +00:00
@ -661,0 +684,4 @@
current_epoch = self.ensure_fresh_epoch()
storage_object = user_container.generate_object(object_size, expire_at=current_epoch + 1)
with allure.step("Lock object for couple epochs"):
Member

We may be more specific here
"Apply first lock to object for 3 epochs"

We may be more specific here `"Apply first lock to object for 3 epochs"`
abereziny marked this conversation as resolved
abereziny reviewed 2023-08-17 16:29:52 +00:00
@ -661,0 +713,4 @@
self.tick_epochs(2)
with allure.step("Check previous lock"):
Member

"Check first lock is still available"

`"Check first lock is still available"`
abereziny marked this conversation as resolved
abereziny reviewed 2023-08-17 16:31:06 +00:00
@ -661,0 +716,4 @@
with allure.step("Check previous lock"):
check_lock_object(lock_object_id_0)
with allure.step("Lock object for couple epochs"):
Member

"Apply second lock to object for 3 more epochs"

"Apply second lock to object for 3 more epochs"
abereziny marked this conversation as resolved
abereziny reviewed 2023-08-17 16:32:32 +00:00
@ -661,0 +728,4 @@
self.tick_epochs(2)
with allure.step("Check previous locks"):
Member

Separate to 2 steps:

Verify first lock is expired and removed
Verify second lock is still available

Separate to 2 steps: `Verify first lock is expired and removed` `Verify second lock is still available`
abereziny marked this conversation as resolved
abereziny reviewed 2023-08-17 16:33:03 +00:00
@ -661,0 +736,4 @@
self.cluster.default_rpc_endpoint)
check_lock_object(lock_object_id_1)
with allure.step("Lock object for couple epochs"):
Member

"Apply third lock to object for 3 more epochs"

"Apply third lock to object for 3 more epochs"
abereziny marked this conversation as resolved
abereziny reviewed 2023-08-17 16:33:44 +00:00
@ -661,0 +746,4 @@
expire_at=current_epoch + 7,
)
with allure.step("Wait for object to be deleted"):
Member

"Verify object is deleted after all locks are expired"

"Verify object is deleted after all locks are expired"
abereziny marked this conversation as resolved
abereziny reviewed 2023-08-17 16:34:51 +00:00
@ -661,0 +755,4 @@
self.cluster.default_rpc_endpoint)
@allure.title("Expired two objects with one lock should be deleted after locks")
Member

Two expired objects with one lock should be deleted after lock expiration

Two expired objects with one lock should be deleted after lock expiration
abereziny marked this conversation as resolved
abereziny reviewed 2023-08-17 16:35:24 +00:00
@ -661,0 +783,4 @@
self.tick_epoch()
with allure.step("Lock object for couple epochs"):
Member

Lock objects for 4(? please use correct number) epochs

`Lock objects for 4(? please use correct number) epochs`
abereziny marked this conversation as resolved
abereziny reviewed 2023-08-17 16:36:34 +00:00
@ -661,0 +793,4 @@
expire_at=current_epoch + 4,
)
with allure.step("Check object is available at expiration time"):
Member

Verify objects are available during next three epochs

Verify objects are available during next three epochs
abereziny marked this conversation as resolved
abereziny reviewed 2023-08-17 16:37:42 +00:00
@ -661,0 +807,4 @@
self.cluster.default_rpc_endpoint,
)
with allure.step("Wait for object to be deleted"):
Member

"Verify objects are deleted after lock was expired"

"Verify objects are deleted after lock was expired"
abereziny marked this conversation as resolved
abereziny reviewed 2023-08-17 16:38:00 +00:00
@ -661,0 +817,4 @@
self.cluster.default_rpc_endpoint)
Member

Redundant new lines (must be one in the end of file)

Redundant new lines (must be one in the end of file)
abereziny marked this conversation as resolved
abereziny reviewed 2023-08-17 16:42:30 +00:00
@ -661,0 +759,4 @@
@pytest.mark.parametrize(
"object_size",
[pytest.lazy_fixture("simple_object_size"), pytest.lazy_fixture("complex_object_size")],
ids=["simple object", "complex object"],
Member

simple object size and complex object size everywhere :)

`simple object size` and `complex object size` everywhere :)
abereziny marked this conversation as resolved
abereziny reviewed 2023-08-17 16:43:11 +00:00
@ -661,0 +674,4 @@
self,
request: FixtureRequest,
user_container: StorageContainer,
object_size: int,
Member

object_size: int -> object_size: ObjectSize everywhere

`object_size: int` -> `object_size: ObjectSize` everywhere
abereziny marked this conversation as resolved
abereziny approved these changes 2023-08-22 10:20:19 +00:00
ChEktn force-pushed feature-2 from 9d9a30b593 to 8ad8e501c1 2023-08-22 10:36:23 +00:00 Compare
abereziny approved these changes 2023-08-22 10:38:55 +00:00
d.zayakin approved these changes 2023-08-23 05:36:18 +00:00
JuliaKovshova approved these changes 2023-08-23 12:04:11 +00:00
ChEktn force-pushed feature-2 from 8ad8e501c1 to d74b483baa 2023-08-30 11:13:19 +00:00 Compare
ChEktn force-pushed feature-2 from d74b483baa to 69cec608a6 2023-08-30 11:38:12 +00:00 Compare
abereziny approved these changes 2023-08-30 11:39:33 +00:00
abereziny requested review from qa-committers 2023-09-01 08:19:02 +00:00
abereziny requested review from qa-developers 2023-09-01 08:19:02 +00:00
d.zayakin approved these changes 2023-09-01 08:56:06 +00:00
abereziny merged commit 3455c5360d into master 2023-09-01 09:06:50 +00:00
Member

Closes #29

Closes #29
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-testcases#80
No description provided.