store only status-change events; UI client-side polling refactor
This commit is contained in:
@@ -125,6 +125,21 @@ api "/api/v1/agents/agent-stale" | grep -q '"status":"dead"' \
|
||||
api "/api/v1/agents/agent-dead" | grep -q '"status":"dead"' \
|
||||
|| fail "agent-dead did not transition to dead"
|
||||
|
||||
log "asserting dead agents have open liveness incidents"
|
||||
api "/api/v1/incidents?state=open&limit=500" | python3 -c "
|
||||
import json,sys
|
||||
d=json.load(sys.stdin)
|
||||
want={'agent-stale','agent-dead'}
|
||||
have={
|
||||
i['agent_id']
|
||||
for i in d['items']
|
||||
if i['check_id']=='agent_liveness' and i['state']=='open' and i['severity']=='critical'
|
||||
}
|
||||
missing=want-have
|
||||
print('liveness incidents:', sorted(have))
|
||||
sys.exit(0 if not missing else 1)" \
|
||||
|| fail "missing critical agent_liveness incident for dead agents"
|
||||
|
||||
# At least one agent must still be alive (agent-mixed keeps pushing).
|
||||
api "/api/v1/agents/agent-mixed" | grep -q '"status":"alive"' \
|
||||
|| fail "agent-mixed not alive"
|
||||
|
||||
Reference in New Issue
Block a user