PBM-1444. Test selective PITR restore with DDL operations in oplog #187
GitHub Actions / JUnit Test Report
failed
Dec 2, 2024 in 0s
42 tests run, 31 passed, 9 skipped, 2 failed.
Annotations
Check failure on line 67 in pbm-functional/pytest/test_PBM-979.py
github-actions / JUnit Test Report
test_PBM-979.test_logical_PBM_T233
AssertionError
Raw output
start_cluster = True, cluster = <cluster.Cluster object at 0x7f7aa1559010>
@pytest.mark.timeout(300,func_only=True)
def test_logical_PBM_T233(start_cluster,cluster):
time.sleep(5) # wait for delayed node
> cluster.check_pbm_status()
test_PBM-979.py:67:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <cluster.Cluster object at 0x7f7aa1559010>
def check_pbm_status(self):
n = testinfra.get_host("docker://" + self.pbm_cli)
result = n.check_output('pbm status --out=json')
parsed_result = json.loads(result)
Cluster.log("PBM status: \n" + str(parsed_result['cluster']))
#Cluster.log(json.dumps(parsed_result['cluster'], indent=4))
hosts = []
for replicaset in parsed_result['cluster']:
for host in replicaset['nodes']:
if host['role'] != "A":
hosts.append(host)
> assert host['ok'] == True
E AssertionError
cluster.py:728: AssertionError
Check failure on line 178 in pbm-functional/pytest/test_rename_replicaset.py
github-actions / JUnit Test Report
test_rename_replicaset.test_logical_pitr_ddl_PBM_T273
AssertionError: assert 'old_index' not in {'_id_': {'key': [('_id', 1)], 'v': 2}, 'new_index': {'key': [('data', 1)], 'v': 2}, 'old_index': {'key': [('key', 1)], 'v': 2}}
+ where {'_id_': {'key': [('_id', 1)], 'v': 2}, 'new_index': {'key': [('data', 1)], 'v': 2}, 'old_index': {'key': [('key', 1)], 'v': 2}} = index_information()
+ where index_information = Collection(Database(MongoClient(host=['rs101:27017'], document_class=dict, tz_aware=False, connect=True), 'restored'), 'indexes').index_information
Raw output
start_cluster = True, cluster = <cluster.Cluster object at 0x7f7aa15bed10>
@pytest.mark.timeout(300,func_only=True)
def test_logical_pitr_ddl_PBM_T273(start_cluster,cluster):
cluster.check_pbm_status()
cluster.make_backup("logical")
cluster.enable_pitr(pitr_extra_args="--set pitr.oplogSpanMin=0.1")
time.sleep(5)
client = pymongo.MongoClient(cluster.connection)
client.drop_database('test')
for i in range(10):
client["test"]["indexes"].insert_one({"key": i+10, "data": i+10})
client["test"]["indexes"].create_index("data",name="new_index")
time.sleep(5)
pitr = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S")
pitr=" --time=" + pitr
Cluster.log("Time for PITR is: " + pitr)
time.sleep(10)
cluster.disable_pitr()
time.sleep(5)
backup=pitr + " --ns-from=test.indexes --ns-to=restored.indexes"
cluster.make_restore(backup)
client = pymongo.MongoClient(cluster.connection)
assert client["restored"]["indexes"].count_documents({})==10
for i in range(10):
assert client["restored"]["indexes"].find_one({"key": i+10, "data": i+10})
assert 'new_index' in client["restored"]["indexes"].index_information()
> assert 'old_index' not in client["restored"]["indexes"].index_information()
E AssertionError: assert 'old_index' not in {'_id_': {'key': [('_id', 1)], 'v': 2}, 'new_index': {'key': [('data', 1)], 'v': 2}, 'old_index': {'key': [('key', 1)], 'v': 2}}
E + where {'_id_': {'key': [('_id', 1)], 'v': 2}, 'new_index': {'key': [('data', 1)], 'v': 2}, 'old_index': {'key': [('key', 1)], 'v': 2}} = index_information()
E + where index_information = Collection(Database(MongoClient(host=['rs101:27017'], document_class=dict, tz_aware=False, connect=True), 'restored'), 'indexes').index_information
test_rename_replicaset.py:178: AssertionError
Loading