mikeal / sequest

Simplified API for SSH and SFTP similar to request.
283 stars 24 forks source link

commands that take too long cause sequest to report an error #13

Open jeffreywescott opened 9 years ago

jeffreywescott commented 9 years ago

Result: { [Error: Exit code is non-zero.] code: undefined, signal: undefined }

Attempted on both 0.7.0 (from npm) and 0.7.1 (from GitHub).

To reproduce, create a script /usr/local/bin/testscript on the remote server that looks like this:

#!/bin/sh

echo "foo"
echo "bar"
sleep 2
echo "baz"
var sequest = require('sequest');

var seq = sequest.connect('user@example.com');

// SUCCEEDS
seq('ls -alFh', function (err, stdout) {
  if (err) throw err;
  console.log(stdout);
  seq.end();
});

// FAILS
seq('testscript', function (err, stdout) {
  if (err) throw err;
  console.log(stdout);
  seq.end();
});
jcrugzz commented 9 years ago

@jeffreywescott hmm thats interesting, as it doesn't seem like it should timeout with that short of a sleep. Could you see if you could dig a little deeper and see what you uncover?