# Time Out As Failure

**URL:** <https://community.postman.com/t/time-out-as-failure/31611>\
**Category:** Help Hub\
**Created:** [January 17, 2022, 8:24am UTC](https://community.postman.com/t/time-out-as-failure/31611 "2022-01-17T08:24:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Innmtho](https://avatars.discourse-cdn.com/v4/letter/i/4da419/32.png) [@Innmtho](https://community.postman.com/u/Innmtho)\
**Post date:** [January 17, 2022, 8:24am UTC](https://community.postman.com/t/time-out-as-failure/31611/1 "2022-01-17T08:24:22Z")

</div>

I would like a TIMEOUT to be considered a test failure. when I receive a response body that is out of threshold, I want to raise that as failure.

I have tried this script below:  
pm.test(“API responds within the expected treshhold”, () =\> {

// set the response time in milliseconds

const expectedTimeInMilliseconds = 5000;

pm.expect(pm.response.responseTime).to.be.lessThan(

```
expectedTimeInMilliseconds + 1,

`The endpoint did not respond within ${expectedTimeInMilliseconds} ms. Response came in ${pm.response.responseTime} ms`

```

);

});

f I set the Postman timeout to 5000 ms and then Collection Test Runner encounters a timeout, it does not consider this a failed test.
