Postman newman - Timeout example

Team

I have postman newman tests scheduled through jenkins. This collection has many end points and tests. If one of the services is failing due to timeout, I would like to fail the test as functional failure. For example, currently if there is a latency issue with one of the end points it fails with the following error. I want this to fail gracefully. Meaning the build can be marked as functional failure after it reaches certain time limit. Where should I specify the timeout in milliseconds?

I was reading the below documentation. If I specify timeout in milli seconds will it be used for all tests in this collection? Is there a way to specify different timeout value for different services?

https://learning.getpostman.com/docs/postman/collection_runs/command_line_integration_with_newman/

TypeError: Cannot read property โ€˜_destroySSLโ€™ of undefined 06:01:41 at Timeout.destroySSL [as _onTimeout] (_tls_wrap.js:546:8) 06:01:41 at listOnTimeout (internal/timers.js:531:17) 06:01:41 at processTimers (internal/timers.js:475:7) 06:01:41 npm ERR! code ELIFECYCLE 06:01:41 npm ERR! errno 1

Thanks, Rjayaram

@rjayaram You are correct on this, the delay-request option applies to all calls in the collection. There is no way that you can specify a delay that is specific to a request other than using a function like:

setTimeout(function(){}, 30000); where this is in millisec.

You can add this to either the Pre-Request or the Tests tabs to have it explicitly wait for that time before proceeding.

Hope this helps answer your question