Files
scylladb/test/rest_api/test_gossiper.py
Pavel Emelyanov 3e09d3cc97 test: Keep test_gossiper_live_endpoints checks togethger
There are two checks for live endpoints performed in test_gossiper.py,
but one of those sits in test_gossiper_unreachable_endpoints somehow.
This patch moves live endpoints check into live endpoints test.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>

Closes scylladb/scylladb#28224
2026-01-23 16:53:48 +02:00

31 lines
1010 B
Python

# Copyright 2023-present ScyllaDB
#
# SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
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