mirror of
https://github.com/go-gost/gost.git
synced 2026-11-06 08:06:20 +00:00
Add an e2e case for the parallel selector configured with maxParallel: 1. With only one node racing per connection the dead node is no longer masked by the live one, so the requests alternate between success and failure - that alternation is what proves the limit is applied. Requires go-gost/x with the parallel selector node limit (gost#916). gost's go.mod still pins v0.19.5, so this test only goes green once that release lands and the dependency is bumped.
35 lines
659 B
YAML
35 lines
659 B
YAML
services:
|
|
- name: proxy
|
|
addr: :8080
|
|
handler:
|
|
type: http
|
|
chain: my-chain
|
|
listener:
|
|
type: tcp
|
|
|
|
- name: dummy-1
|
|
addr: :18081
|
|
handler:
|
|
type: http
|
|
|
|
chains:
|
|
- name: my-chain
|
|
hops:
|
|
- name: hop-1
|
|
selector:
|
|
strategy: parallel
|
|
# Only one node takes part in each race.
|
|
maxParallel: 1
|
|
parallelMode: round
|
|
nodes:
|
|
- name: node-1
|
|
addr: 127.0.0.1:18081
|
|
connector:
|
|
type: http
|
|
# dead node: never listens; it is no longer masked by the live node
|
|
# because the two of them no longer race concurrently.
|
|
- name: node-2
|
|
addr: 127.0.0.1:18082
|
|
connector:
|
|
type: http
|