Files
scylladb/test/rest_api/test_gossiper.py
Avi Kivity 0ae22a09d4 LICENSE: Update to version 1.1
Updated terms of non-commercial use (must be a never-customer).
2026-04-12 19:46:33 +03:00

31 lines
1010 B
Python

# Copyright 2023-present ScyllaDB
#
# SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.1
import pytest
import sys
import requests
import threading
import time
def test_gossiper_live_endpoints(cql, rest_api):
resp = rest_api.send("GET", f"gossiper/endpoint/live")
resp.raise_for_status()
live_endpoints = set(resp.json())
all_hosts_endpoints = set([host.address for host in cql.cluster.metadata.all_hosts()])
assert live_endpoints == all_hosts_endpoints
for ep in live_endpoints:
resp = rest_api.send("GET", f"gossiper/downtime/{ep}")
resp.raise_for_status()
assert int(resp.json()) == 0
def test_gossiper_unreachable_endpoints(cql, rest_api):
resp = rest_api.send("GET", f"gossiper/endpoint/down")
resp.raise_for_status()
unreachable_endpoints = set(resp.json())
for ep in unreachable_endpoints:
resp = rest_api.send("GET", f"gossiper/downtime/{ep}")
resp.raise_for_status()
assert int(resp.json()) > 0