e2e: add node liveness probe tests

TCP probe + FailFilter: dead node pre-marked, all requests succeed.
LowestLatency strategy: two probed nodes, selector picks fastest.
This commit is contained in:
ginuerzh
2026-07-16 20:53:30 +08:00
parent 1c6fadcb1e
commit bef00dffef
3 changed files with 183 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
services:
- name: proxy
addr: :8080
handler:
type: http
chain: my-chain
listener:
type: tcp
# Two live relays — both forward to the echo server.
- name: relay-a
addr: 127.0.0.1:18081
handler:
type: http
listener:
type: tcp
- name: relay-b
addr: 127.0.0.1:18082
handler:
type: http
listener:
type: tcp
chains:
- name: my-chain
hops:
- name: hop-1
selector:
strategy: lowestlatency
maxFails: 1
failTimeout: 10s
nodes:
- name: node-a
addr: 127.0.0.1:18081
connector:
type: http
probe:
type: tcp
addr: 127.0.0.1:18081
interval: 5s
- name: node-b
addr: 127.0.0.1:18082
connector:
type: http
probe:
type: tcp
addr: 127.0.0.1:18082
interval: 5s
+44
View File
@@ -0,0 +1,44 @@
services:
- name: proxy
addr: :8080
handler:
type: http
chain: my-chain
listener:
type: tcp
# Live relay: forwards to the echo server.
- name: relay
addr: 127.0.0.1:18081
handler:
type: http
listener:
type: tcp
chains:
- name: my-chain
hops:
- name: hop-1
selector:
strategy: round
maxFails: 1
failTimeout: 10s
nodes:
- name: node-live
addr: 127.0.0.1:18081
connector:
type: http
probe:
type: tcp
addr: 127.0.0.1:18081
interval: 5s
# dead node: probed, marked as failed by the probe goroutine,
# then excluded by FailFilter before any real traffic tries it.
- name: node-dead
addr: 127.0.0.1:18082
connector:
type: http
probe:
type: tcp
addr: 127.0.0.1:18082
interval: 5s