Skip to content

[PBM-1141] delete backups of specific type #151

[PBM-1141] delete backups of specific type

[PBM-1141] delete backups of specific type #151

This check has been archived and is scheduled for deletion. Learn more about checks retention
GitHub Actions / JUnit Test Report failed Oct 7, 2023 in 0s

14 tests run, 12 passed, 0 skipped, 2 failed.

Annotations

Check failure on line 93 in psmdb-testing/pbm-functional/pytest/test_azurite.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_azurite.test_logical_pitr

AssertionError: Unexpected exit code 1 for CommandResult(command=b'pbm delete-backup -y 2023-10-07T17:33:47Z', exit_status=1, stdout=None, stderr=b'Error: schedule delete: unable to delete the last backup while PITR is enabled\n')
assert 1 == 0
 +  where 1 = CommandResult(command=b'pbm delete-backup -y 2023-10-07T17:33:47Z', exit_status=1, stdout=None, stderr=b'Error: schedule delete: unable to delete the last backup while PITR is enabled\n').rc
Raw output
start_cluster = True, cluster = <cluster.Cluster object at 0x7f835ea6a410>

    @pytest.mark.timeout(500, func_only=True)
    def test_logical_pitr(start_cluster,cluster):
        cluster.check_pbm_status()
        pymongo.MongoClient(cluster.connection)["test"]["test"].insert_many(documents)
        backup_l1=cluster.make_backup("logical")
        cluster.enable_pitr(pitr_extra_args="--set pitr.oplogSpanMin=0.5")
        time.sleep(60)
        # make several following backups and then remove them to check the continuity of PITR timeframe
        pymongo.MongoClient(cluster.connection)["test"]["test2"].insert_many(documents)
        backup_l2=cluster.make_backup("logical")
        time.sleep(60)
        pymongo.MongoClient(cluster.connection)["test"]["test3"].insert_many(documents)
        backup_l3=cluster.make_backup("logical")
        pitr = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S")
        backup="--time=" + pitr
        Cluster.log("Time for PITR is: " + pitr)
        time.sleep(60)
        cluster.delete_backup(backup_l2)
>       cluster.delete_backup(backup_l3)

test_azurite.py:93: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <cluster.Cluster object at 0x7f835ea6a410>, name = '2023-10-07T17:33:47Z'

    def delete_backup(self, name):
        n = testinfra.get_host("docker://" + self.pbm_cli)
>       result = n.check_output('pbm delete-backup -y ' + name)
E       AssertionError: Unexpected exit code 1 for CommandResult(command=b'pbm delete-backup -y 2023-10-07T17:33:47Z', exit_status=1, stdout=None, stderr=b'Error: schedule delete: unable to delete the last backup while PITR is enabled\n')
E       assert 1 == 0
E        +  where 1 = CommandResult(command=b'pbm delete-backup -y 2023-10-07T17:33:47Z', exit_status=1, stdout=None, stderr=b'Error: schedule delete: unable to delete the last backup while PITR is enabled\n').rc

cluster.py:801: AssertionError

Check failure on line 96 in psmdb-testing/pbm-functional/pytest/test_sharded.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_sharded.test_logical_pitr

AssertionError: Unexpected exit code 1 for CommandResult(command=b'pbm delete-backup -y 2023-10-07T17:49:50Z', exit_status=1, stdout=None, stderr=b'Error: schedule delete: unable to delete the last backup while PITR is enabled\n')
assert 1 == 0
 +  where 1 = CommandResult(command=b'pbm delete-backup -y 2023-10-07T17:49:50Z', exit_status=1, stdout=None, stderr=b'Error: schedule delete: unable to delete the last backup while PITR is enabled\n').rc
Raw output
start_cluster = True, cluster = <cluster.Cluster object at 0x7f835e9f6650>

    @pytest.mark.testcase(test_case_key="T194", test_step_key=1)
    @pytest.mark.timeout(500, func_only=True)
    def test_logical_pitr(start_cluster,cluster):
        cluster.check_pbm_status()
        pymongo.MongoClient(cluster.connection)["test"]["test"].insert_many(documents)
        backup_l1=cluster.make_backup("logical")
        cluster.enable_pitr(pitr_extra_args="--set pitr.oplogSpanMin=0.5")
        time.sleep(60)
        # make several following backups and then remove them to check the continuity of PITR timeframe
        pymongo.MongoClient(cluster.connection)["test"]["test2"].insert_many(documents)
        backup_l2=cluster.make_backup("logical")
        time.sleep(60)
        pymongo.MongoClient(cluster.connection)["test"]["test3"].insert_many(documents)
        backup_l3=cluster.make_backup("logical")
        pitr = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S")
        backup="--time=" + pitr
        Cluster.log("Time for PITR is: " + pitr)
        time.sleep(60)
        cluster.delete_backup(backup_l2)
>       cluster.delete_backup(backup_l3)

test_sharded.py:96: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <cluster.Cluster object at 0x7f835e9f6650>, name = '2023-10-07T17:49:50Z'

    def delete_backup(self, name):
        n = testinfra.get_host("docker://" + self.pbm_cli)
>       result = n.check_output('pbm delete-backup -y ' + name)
E       AssertionError: Unexpected exit code 1 for CommandResult(command=b'pbm delete-backup -y 2023-10-07T17:49:50Z', exit_status=1, stdout=None, stderr=b'Error: schedule delete: unable to delete the last backup while PITR is enabled\n')
E       assert 1 == 0
E        +  where 1 = CommandResult(command=b'pbm delete-backup -y 2023-10-07T17:49:50Z', exit_status=1, stdout=None, stderr=b'Error: schedule delete: unable to delete the last backup while PITR is enabled\n').rc

cluster.py:801: AssertionError