Skip to content

Commit

Permalink
Fix timeout tests
Browse files Browse the repository at this point in the history
  • Loading branch information
codenirvana committed Aug 20, 2024
1 parent c2991f7 commit 776d370
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/cli/run-options.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('CLI run options', function () {
describe('script timeouts', function () {
it('should be handled correctly when breached', function (done) {
// eslint-disable-next-line max-len
exec('node ./bin/newman.js run test/integration/timeout/timeout.postman_collection.json --timeout-script 100', function (code) {
exec('node ./bin/newman.js run test/integration/timeout/timeout.postman_collection.json --timeout-script 5', function (code) {
// .to.be.(1) is not used as the windows exit code can be an arbitrary non-zero value
expect(code, 'should have non-zero exit code').to.be.above(0);
done();
Expand All @@ -121,7 +121,7 @@ describe('CLI run options', function () {

it('should be handled correctly when not breached', function (done) {
// eslint-disable-next-line max-len
exec('node ./bin/newman.js run test/integration/timeout/timeout.postman_collection.json --timeout-script 800', function (code) {
exec('node ./bin/newman.js run test/integration/timeout/timeout.postman_collection.json --timeout-script 500', function (code) {
expect(code, 'should have exit code of 0').to.equal(0);
done();
});
Expand Down
2 changes: 1 addition & 1 deletion test/integration/timeout/timeout.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "text/javascript",
"exec": [
"var now = Date.now(),",
" later = now + 700;",
" later = now + 300;",
"while(Date.now() < later);"
]
}
Expand Down
2 changes: 1 addition & 1 deletion test/library/run-options.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ describe('Newman run options', function () {
it('should be handled correctly when breached', function (done) {
newman.run({
collection: 'test/integration/timeout/timeout.postman_collection.json',
timeout: 100
timeout: 1000
}, function (err, summary) {
expect(err.message).to.equal('callback timed out');
expect(summary).to.be.ok;
Expand Down

0 comments on commit 776d370

Please sign in to comment.