Skip to content

Commit

Permalink
finding a dbserver
Browse files Browse the repository at this point in the history
  • Loading branch information
apetenchea committed Jan 30, 2024
1 parent b519261 commit f71f9fb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,16 @@ def test_cluster_server_maintenance_mode(sys_db, bad_db, cluster):
if not cluster:
pytest.skip("Only tested in a cluster setup")

server_id = sys_db.cluster.server_id()
# Must be a DBServer
health = sys_db.cluster.health()
server_id = None
for server_id, info in health["Health"].items():
if info["Role"] == "DBServer":
server_id = server_id
break
if server_id is None:
pytest.skip("No DBServer found in cluster")

result = sys_db.cluster.server_maintenance_mode(server_id)
assert result == {}

Expand Down

0 comments on commit f71f9fb

Please sign in to comment.