PBM-1208: Add active lock check before running the backup #399
GitHub Actions / JUnit Test Report
failed
Aug 9, 2024 in 0s
19 tests run, 14 passed, 2 skipped, 3 failed.
Annotations
Check failure on line 59 in psmdb-testing/pbm-functional/pytest/test_PBM-1171.py
github-actions / JUnit Test Report
test_PBM-1171.test_physical_mixed_env_PBM_T248
assert 1 == 0
+ where 1 = CommandResult(backend=<testinfra.backend.docker.DockerBackend object at 0x7f5afd576b90>, exit_status=1, command=b'pbm ...T11:01:40Z'.................................", _stderr=b'Error: get backup metadata: get: context deadline exceeded\n').rc
+ where CommandResult(backend=<testinfra.backend.docker.DockerBackend object at 0x7f5afd576b90>, exit_status=1, command=b'pbm ...T11:01:40Z'.................................", _stderr=b'Error: get backup metadata: get: context deadline exceeded\n') = exec_pbm_cli('backup -t physical --wait')
+ where exec_pbm_cli = <cluster.Cluster object at 0x7f5afc1454d0>.exec_pbm_cli
Raw output
start_cluster = True, cluster = <cluster.Cluster object at 0x7f5afc1454d0>
@pytest.mark.timeout(600,func_only=True)
def test_physical_mixed_env_PBM_T248(start_cluster,cluster):
cluster.check_pbm_status()
pymongo.MongoClient(cluster.connection)["test"]["test"].insert_many(documents)
#primary cfgsrv - CE, else - PSMDB, backup should pass
Cluster.psmdb_to_ce("rscfg01")
cluster.check_pbm_status()
> assert cluster.exec_pbm_cli("backup -t physical --wait").rc == 0
E assert 1 == 0
E + where 1 = CommandResult(backend=<testinfra.backend.docker.DockerBackend object at 0x7f5afd576b90>, exit_status=1, command=b'pbm ...T11:01:40Z'.................................", _stderr=b'Error: get backup metadata: get: context deadline exceeded\n').rc
E + where CommandResult(backend=<testinfra.backend.docker.DockerBackend object at 0x7f5afd576b90>, exit_status=1, command=b'pbm ...T11:01:40Z'.................................", _stderr=b'Error: get backup metadata: get: context deadline exceeded\n') = exec_pbm_cli('backup -t physical --wait')
E + where exec_pbm_cli = <cluster.Cluster object at 0x7f5afc1454d0>.exec_pbm_cli
test_PBM-1171.py:59: AssertionError
Check failure on line 56 in psmdb-testing/pbm-functional/pytest/test_PBM-1228.py
github-actions / JUnit Test Report
test_PBM-1228.test_pitr_PBM_T256[base-physical]
AssertionError: couldn't get response from all shards: convergeClusterWithTimeout: 33s: reached converge timeout
Raw output
start_cluster = True, cluster = <cluster.Cluster object at 0x7f5afc0fec10>
backup_type = 'physical', base_snapshot = 'base'
@pytest.mark.timeout(900,func_only=True)
@pytest.mark.parametrize('backup_type',['logical','physical'])
@pytest.mark.parametrize('base_snapshot',['base','profile'])
def test_pitr_PBM_T256(start_cluster,cluster,backup_type,base_snapshot):
def insert_docs():
client=pymongo.MongoClient(cluster.connection)
for i in range(1500):
client['test']['test'].insert_one({"doc":i})
time.sleep(0.1)
cluster.check_pbm_status()
> base_backup=cluster.make_backup(backup_type)
test_PBM-1228.py:56:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <cluster.Cluster object at 0x7f5afc0fec10>, type = 'physical'
def make_backup(self, type):
n = testinfra.get_host("docker://" + self.pbm_cli)
timeout = time.time() + 120
while True:
running = self.get_status()['running']
Cluster.log("Current operation: " + str(running))
if not running:
if type:
start = n.run(
'pbm backup --out=json --type=' + type)
else:
start = n.run('pbm backup --out=json')
if start.rc == 0:
name = json.loads(start.stdout)['name']
Cluster.log("Backup started")
break
elif "resync" in start.stdout:
Cluster.log("Resync in progress, retrying: " + start.stdout)
else:
assert False, "Backup failed" + start.stdout + start.stderr
if time.time() > timeout:
assert False, "Timeout for backup start exceeded"
time.sleep(1)
timeout = time.time() + 900
while True:
status = self.get_status()
Cluster.log("Current operation: " + str(status['running']))
if status['backups']['snapshot']:
for snapshot in status['backups']['snapshot']:
if snapshot['name'] == name:
if snapshot['status'] == 'done':
Cluster.log("Backup found: " + str(snapshot))
return name
break
elif snapshot['status'] == 'error':
self.get_logs()
> assert False, snapshot['error']
E AssertionError: couldn't get response from all shards: convergeClusterWithTimeout: 33s: reached converge timeout
cluster.py:409: AssertionError
Check failure on line 56 in psmdb-testing/pbm-functional/pytest/test_PBM-1228.py
github-actions / JUnit Test Report
test_PBM-1228.test_pitr_PBM_T256[profile-physical]
AssertionError: couldn't get response from all shards: convergeClusterWithTimeout: 33s: reached converge timeout
Raw output
start_cluster = True, cluster = <cluster.Cluster object at 0x7f5afc0fec10>
backup_type = 'physical', base_snapshot = 'profile'
@pytest.mark.timeout(900,func_only=True)
@pytest.mark.parametrize('backup_type',['logical','physical'])
@pytest.mark.parametrize('base_snapshot',['base','profile'])
def test_pitr_PBM_T256(start_cluster,cluster,backup_type,base_snapshot):
def insert_docs():
client=pymongo.MongoClient(cluster.connection)
for i in range(1500):
client['test']['test'].insert_one({"doc":i})
time.sleep(0.1)
cluster.check_pbm_status()
> base_backup=cluster.make_backup(backup_type)
test_PBM-1228.py:56:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <cluster.Cluster object at 0x7f5afc0fec10>, type = 'physical'
def make_backup(self, type):
n = testinfra.get_host("docker://" + self.pbm_cli)
timeout = time.time() + 120
while True:
running = self.get_status()['running']
Cluster.log("Current operation: " + str(running))
if not running:
if type:
start = n.run(
'pbm backup --out=json --type=' + type)
else:
start = n.run('pbm backup --out=json')
if start.rc == 0:
name = json.loads(start.stdout)['name']
Cluster.log("Backup started")
break
elif "resync" in start.stdout:
Cluster.log("Resync in progress, retrying: " + start.stdout)
else:
assert False, "Backup failed" + start.stdout + start.stderr
if time.time() > timeout:
assert False, "Timeout for backup start exceeded"
time.sleep(1)
timeout = time.time() + 900
while True:
status = self.get_status()
Cluster.log("Current operation: " + str(status['running']))
if status['backups']['snapshot']:
for snapshot in status['backups']['snapshot']:
if snapshot['name'] == name:
if snapshot['status'] == 'done':
Cluster.log("Backup found: " + str(snapshot))
return name
break
elif snapshot['status'] == 'error':
self.get_logs()
> assert False, snapshot['error']
E AssertionError: couldn't get response from all shards: convergeClusterWithTimeout: 33s: reached converge timeout
cluster.py:409: AssertionError
Loading