Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When testing on a loaded server, a socket hang up in a loop causes the whole test to hang #234

Closed
aduchate opened this issue Dec 22, 2016 · 3 comments
Labels

Comments

@aduchate
Copy link

aduchate commented Dec 22, 2016

The problem seems to happen in engine_utils.js within:

return function aLoop(context, callback) {
    let i = from;
    let newContext = context;
    let loopIndexVar = (opts && opts.loopValue) || '$loopCount';

    newContext.vars[loopIndexVar] = i;
    A.whilst(
      function test() {
        return i < to || to === -1;
      },
      function repeated(cb) {
        let zero = function(cb2) {
          return cb2(null, newContext);
        };
        let steps2 = L.flatten([zero, steps]);
        A.waterfall(steps2, function(err, context2) {
          i++;
          newContext = context2;
	  newContext.vars[loopIndexVar]++;
	  return cb(err, context2);
        });
      },
      function(err, finalContext) {
        return callback(err, finalContext);
      });
  };

where function(err, context2) {...} is called with a null context and err set to Error: socket hang up and newContext.vars triggers an exception

@aduchate
Copy link
Author

Inserting if (!context2) return cb(err, context2); before newContext = context2;improves the behaviour. But I am not sure about what it implies in terms of loopIndexVar increment.

@hassy hassy added the bug label Jan 4, 2017
@hassy
Copy link
Member

hassy commented Jan 4, 2017

thanks @aduchate

hassy added a commit to hassy/artillery-core that referenced this issue Jan 10, 2017
Prevent errors in loop steps (such as an ETIMEDOUT) from crashing
the process.

Ref: artilleryio/artillery#234
@hassy
Copy link
Member

hassy commented Jan 10, 2017

Fixed in artilleryio/artillery-core#138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants