Shopify / toxiproxy

:alarm_clock: :fire: A TCP proxy to simulate network and system conditions for chaos and resiliency testing

Home Page:https://github.com/shopify/toxiproxy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to update toxic using prebuilt windows server

mikeucfl opened this issue · comments

I'm fairly new to Toxiproxy and was going through some examples to understand how to utilize it. I downloaded the prebuilt binaries for 2.7.0 and ran into an issue when trying to update a toxic.

$ toxiproxy-cli-windows-amd64.exe -v
toxiproxy-cli version 2.7.0

$ toxiproxy-cli-windows-amd64.exe create --listen 127.0.0.1:9100 --upstream 127.0.0.1:9000 myProxy
Created new proxy myProxy

$ toxiproxy-cli-windows-amd64.exe toxic add -t latency -n myToxic -a latency=100 -a jitter=50 myProxy
Added downstream latency toxic 'myToxic' on proxy 'myProxy'

$ toxiproxy-cli-windows-amd64.exe toxic update -n myToxic -a jitter=25 myProxy
Failed to update toxic: failed to update toxic 'myToxic' of proxy 'myProxy': json: cannot unmarshal number into Go value of type toxiproxy.ApiError

I went to grab the source and debug what was going on, and it seems like the issue originates with the server. If I run the server from source I'm able to update the value with no issues (using commit 7abcb6f)

$ go run cli.go create --listen 127.0.0.1:9100 --upstream 127.0.0.1:9000 myProxy
Created new proxy myProxy

$ go run cli.go toxic add -t latency -n myToxic -a latency=100 -a jitter=50 myProxy
Added downstream latency toxic 'myToxic' on proxy 'myProxy'

$ go run cli.go toxic update -n myToxic -a jitter=25 myProxy
Updated toxic 'myToxic' on proxy 'myProxy'

I took a look at wireshark to compare the responses (left is prebuilt server using prebuilt cli, and right is running server from source with prebuilt cli)
image

Is there something I'm doing wrong with the prebuilt version, or is this some sort of bug? Thanks!