tsenart / vegeta

HTTP load testing tool and library. It's over 9000!
http://godoc.org/github.com/tsenart/vegeta/lib
MIT License
23.5k stars 1.36k forks source link

"Extra data in buffer" when trying to generate report #204

Closed BenjiZombie closed 8 years ago

BenjiZombie commented 8 years ago

Hi,

  1. What version of the project are you using? v6.1.1
  2. What operating system and processor architecture are you using? Windows 10 (I know, I know), x64 go version go1.7.3 windows/amd64
  3. What did you do?
PS C:\Temp> echo "GET https://localhost/" | ./vegeta attack -insecure -duration=120s -workers=200 > results.bin

PS C:\Temp> cat .\results.bin | ./vegeta.exe report
  1. What did you expect to see? Textual report
  2. What did you see instead? extra data in buffer

It seems I can't generate any report (tried plot and the others as well) under Windows. results.bin file is 1MB in size.

Have you had any success under Windows?

Thanks

tsenart commented 8 years ago

Can you attach your results.bin in here for me to debug?

BenjiZombie commented 8 years ago

results.zip

Thanks

tsenart commented 8 years ago

If you attempt a shorter attack and let it finish -duration=5s, does this still happen?

BenjiZombie commented 8 years ago

Unfortunately, yes:

PS C:\Temp> echo "GET https://www.google.com/" | ./vegeta attack -insecure -duration=5s | tee results2.bin | ./vegeta report
2016/10/26 09:51:10 extra data in buffer

results2.zip

tsenart commented 8 years ago

I'm setting up a Windows VM to try to reproduce this.

tsenart commented 8 years ago

Man, I can't even run a command on a Windows prompt. :-(

Are you on normal command prompt, Powershell or BASH with the latest Linux compatibility mode?

BenjiZombie commented 8 years ago

Using PowerShell

tsenart commented 8 years ago

OK, the problem seems to be in the stdout / stdin in Powershell. Things seem to get corrupted with pipes and stdout redirection. Try this instead:

echo "GET https://www.google.com/" | ./vegeta attack -insecure -duration=2s -output="results.bin"
vegeta report -inputs="results.bin"
tsenart commented 8 years ago

And this explains the why: https://brianreiter.org/2010/01/29/powershells-object-pipeline-corrupts-piped-binary-data/

This isn't a Vegeta problem, so closing this issue. Thanks for the report.