Time Out As Failure

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;


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.