Skip to content

Commit 6bd423f

Browse files
committed
Fix Fedora 11.8 test for replication
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
1 parent 57ab64b commit 6bd423f

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

test/test_container_replication.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from time import sleep
33

44
from container_ci_suite.container_lib import ContainerTestLib
5-
from container_ci_suite.container_lib import DatabaseWrapper
5+
from container_ci_suite.engines.database import DatabaseWrapper
66
from container_ci_suite.engines.podman_wrapper import PodmanCLIWrapper
77

88
from conftest import VARS
@@ -69,17 +69,23 @@ def test_replication(self):
6969
username="root",
7070
password="root",
7171
)
72-
result = self.db_wrapper_api.run_sql_command(
73-
container_ip=master_cip,
74-
username="root",
75-
password="root",
76-
container_id=master_cid,
77-
database=VARS.DB_NAME,
78-
sql_cmd="SHOW SLAVE HOSTS;",
79-
podman_run_command="exec",
80-
)
81-
assert slave_cip in result, (
82-
f"Replica {slave_cip} not found in MASTER {master_cip}"
72+
slave_found = False
73+
for _ in range(3):
74+
result = self.db_wrapper_api.run_sql_command(
75+
container_ip=master_cip,
76+
username="root",
77+
password="root",
78+
container_id=master_cid,
79+
database=VARS.DB_NAME,
80+
sql_cmd="SHOW SLAVE HOSTS;",
81+
podman_run_command="exec",
82+
)
83+
if slave_cip in result:
84+
slave_found = True
85+
break
86+
sleep(1)
87+
assert slave_found, (
88+
f"Replica {slave_cip} not found in MASTER {master_cip} after 3 attempts. See logs for more details. Result: {result}"
8389
)
8490
assert self.replication_db.test_db_connection(
8591
container_ip=slave_cip,

0 commit comments

Comments
 (0)