docs(conductor): Synchronize tech-stack and commit monitor script updates
This commit is contained in:
@@ -23,8 +23,8 @@ def test_aggregate_cluster_status(mock_node_map, mock_nomad_allocs, mock_litefs,
|
||||
# Mock LiteFS data
|
||||
def litefs_side_effect(addr, **kwargs):
|
||||
if addr == "1.1.1.1":
|
||||
return {"is_primary": True, "uptime": 100, "dbs": {"db1": {}}}
|
||||
return {"is_primary": False, "uptime": 50, "dbs": {"db1": {}}}
|
||||
return {"is_primary": True, "candidate": True, "uptime": 100, "dbs": {"db1": {"txid": "0000000000000001", "checksum": "abc"}}}
|
||||
return {"is_primary": False, "candidate": True, "uptime": 50, "dbs": {"db1": {"txid": "0000000000000001", "checksum": "abc"}}}
|
||||
|
||||
mock_litefs.side_effect = litefs_side_effect
|
||||
|
||||
@@ -35,11 +35,8 @@ def test_aggregate_cluster_status(mock_node_map, mock_nomad_allocs, mock_litefs,
|
||||
|
||||
node1 = next(n for n in cluster_data["nodes"] if n["node"] == "node1")
|
||||
assert node1["litefs_primary"] is True
|
||||
assert node1["status"] == "passing"
|
||||
|
||||
node2 = next(n for n in cluster_data["nodes"] if n["node"] == "node2")
|
||||
assert node2["litefs_primary"] is False
|
||||
assert node2["status"] == "standby" # Not in Consul but replica
|
||||
assert node1["candidate"] is True
|
||||
assert "db1" in node1["dbs"]
|
||||
|
||||
@patch("consul_client.get_cluster_services")
|
||||
@patch("litefs_client.get_node_status")
|
||||
@@ -53,7 +50,7 @@ def test_aggregate_cluster_status_unhealthy(mock_node_map, mock_nomad_logs, mock
|
||||
{"id": "alloc1", "node": "node1", "ip": "1.1.1.1"}
|
||||
]
|
||||
# Primary in LiteFS but missing in Consul
|
||||
mock_litefs.return_value = {"is_primary": True, "uptime": 100, "dbs": {"db1": {}}}
|
||||
mock_litefs.return_value = {"is_primary": True, "candidate": True, "uptime": 100, "dbs": {"db1": {"txid": "1", "checksum": "abc"}}}
|
||||
mock_consul.return_value = []
|
||||
mock_nomad_logs.return_code = 0
|
||||
mock_nomad_logs.return_value = "error logs"
|
||||
|
||||
Reference in New Issue
Block a user