Skip to content

Commit

Permalink
fix up
Browse files Browse the repository at this point in the history
Signed-off-by: Mahesh Shetty <[email protected]>
  • Loading branch information
mashetty330 committed Jun 14, 2024
1 parent d252c8d commit fa0e390
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tests/functional/object/mcg/test_write_to_bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,20 +493,22 @@ def test_nb_db_activity_logs_on_io(
bucket.name,
test_directory_setup.origin_dir,
amount=1,
mcg_obj=mcg_obj,
)[0]
logger.info(f"uploaded object {obj_uploaded} to the bucket")

rm_object_recursive(awscli_pod_session, bucket.name, mcg_obj)
logger.info("deleted all the objects from the bucket")

nb_activitylogs = exec_nb_db_query("SELECT data ->> 'event' FROM activitylogs;")
logger.info("successfully fetched noobaa db activitylogs data")
logger.info(nb_activitylogs)
nb_activitylogs = [line for line in nb_activitylogs if obj_uploaded in line]

logger.info("Checking 6 times for successful checks")
tries = 0
while tries <= 6:
nb_activitylogs = [
line
for line in exec_nb_db_query("SELECT data FROM activitylogs;")
if obj_uploaded in line
]
logger.info("successfully fetched noobaa db activitylogs data")

assert "obj.uploaded" not in str(
nb_activitylogs
), "Object upload event is being logged in activitylogs table"
Expand All @@ -516,4 +518,5 @@ def test_nb_db_activity_logs_on_io(
logger.info(
"No object upload/deletion info is being updated in the activitylogs table"
)
time.sleep(10)
time.sleep(60)
tries += 1

0 comments on commit fa0e390

Please sign in to comment.