Postman Runner to fail test on no connection

I have a test case, where I need to test GKE (kubernetes) transition to another pod so a simple HA-test with frequent sequantial or parallel requests to see if the cloud loadbalancer handles its tasks.

Now, the Runner Results and Summary appears to react on Test cases, so that if Runner->service has a connection problem, the Runner Summary report does not show this.

Runner Results does show “An error occurred while running this request. Check Postman Console for more info.” per connection attempt.
This is a little bit hard to find if you have, say, 10,000 attempts and one connection failure.

So my, question is, at Postman Test level, how can I capture a connection failure?

My current test is:
pm.test(“Status code is 200 ad JSON OK”, function () {
pm.response.to.have.status(200);
const jsonData = pm.response.json();
pm.expect(jsonData).to.be.an(“object”);
});

BR, Timo

Hey @tikarhu,
If you use a Monitor instead of a runner, you can get a notification each time something fails. So if there is indeed a connection failure, then I’m assuming the status code would be other than 200 or you could set a timeout like here I think you could also do a timeout via the script, which should ideally fail this test and send you an alert.

Let me know if this helps, or feel free to provide more information about the problem at hand.

Thank you for your reply, Dhanani!

my main problem appears to be that tests are not evaluated if there is a connection error of some kind. Thus I have no http statuscode of any kind.
Not sure if monitor will help but I’ll look into it.

Thanks!

BR,
Timo