Shopify / toxiproxy

:alarm_clock: :fire: A TCP proxy to simulate network and system conditions for chaos and resiliency testing
https://github.com/shopify/toxiproxy
MIT License
10.5k stars 446 forks source link

toxicity parameter ignored #272

Closed tboloo closed 4 years ago

tboloo commented 4 years ago

My setup: toxicity 2.1.4 in docker, redis 5.0.7 also in docker.

I have created proxy to redis, and later added toxicity with probablity 0.7 to it. Inspect shows that proxy was configured correctly,

/go/bin # ./toxiproxy-cli  inspect redis
Name: redis     Listen: [::]:26379      Upstream: redis:6379
======================================================================
Upstream toxics:
Proxy has no Upstream toxics enabled.

Downstream toxics:
timeout:        type=timeout    stream=downstream       toxicity=0.70   attributes=[    timeout=5000    ]

With such proxy I would expect that 7 out of 10 times the connection would timeout, however in reality it does not timeout at all, or at most once:

$ docker run -it --rm --net toxic redis:5.0.7 redis-cli -h proxy -p 26379
proxy:26379> get test
"100"
proxy:26379> get test2
"abcd"
proxy:26379> get adasd
(nil)
proxy:26379> set asdasd sadasd
OK
proxy:26379> get efas
(nil)
proxy:26379> get t
(nil)
proxy:26379> get t
(nil)
proxy:26379> get t
(nil)
proxy:26379> get t
(nil)
proxy:26379> get t
(nil)
proxy:26379> get t
(nil)
proxy:26379> get t
(nil)
proxy:26379>
tboloo commented 4 years ago

My bad, redis-cli keeps connection open, so obviously it will affect at most one operation...