diff --git a/test/library/run-options.test.js b/test/library/run-options.test.js index 0fa90e4ad..80abb7c13 100644 --- a/test/library/run-options.test.js +++ b/test/library/run-options.test.js @@ -203,7 +203,9 @@ describe('Newman run options', function () { }, function (err, summary) { expect(err).to.be.null; expect(summary.run.failures).to.be.an('array').that.has.lengthOf(1); - expect(summary.run.failures[0].error.message).to.equal('ESOCKETTIMEDOUT'); + // The timeout can happen before or after the connection has been established. Thus testing + // for both 'ETIMEDOUT' and 'ESOCKETTIMEDOUT' + expect(summary.run.failures[0].error.message).to.be.oneOf(['ETIMEDOUT', 'ESOCKETTIMEDOUT']); done(); }); });