Skip to content

Fixed script and global timeout tests #3264

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

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 5', function (code) {
exec('node ./bin/newman.js run test/integration/timeout/timeout.postman_collection.json --timeout-script 100', 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 500', function (code) {
exec('node ./bin/newman.js run test/integration/timeout/timeout.postman_collection.json --timeout-script 800', 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 + 300;",
" later = now + 700;",
"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: 1000
timeout: 100
}, function (err, summary) {
expect(err.message).to.equal('callback timed out');
expect(summary).to.be.ok;
Expand Down
Loading