mcollina / autocannon

fast HTTP/1.1 benchmarking tool written in Node.js
MIT License
7.83k stars 325 forks source link

error when redirecting output #60

Closed bzoz closed 8 years ago

bzoz commented 8 years ago

Under Linux, with node 6.3.0. Also happens on master:

autocannon -d 1 example.com > out 2>&1

Result - error in node_modules/progress/lib/node-progress.js:177:

TypeError: this.stream.clearLine is not a function

Happens only if both stdout and stderr are redirected.

mcollina commented 8 years ago

thanks for reporting @bzoz. We'll get it fixed asap.

Just checking, why would you want to do that? You can have the results in as autocannon -d 1 -j example.com > out.json, and have the reporting on stderr. I'm trying to understand the use case :).

bzoz commented 8 years ago

@mcollina I got this when I tried to run autocannon as a script from node

mcollina commented 8 years ago

Sorry about that, it was broken in the latest patch release, we'll fix it tomorrow.

mcollina commented 8 years ago

The fix is in the pr above ^^.

Let me know when the options you are using in core are finalized (if I remember correctly, you were using json output), I'll add a test specific for that use case, so we don't break it accidentally anymore.