# Newman returns successful despite failures

**URL:** <https://community.postman.com/t/newman-returns-successful-despite-failures/35428>\
**Category:** Help Hub\
**Tags:** newman-project, tests, collections\
**Created:** [May 18, 2022, 10:18am UTC](https://community.postman.com/t/newman-returns-successful-despite-failures/35428 "2022-05-18T10:18:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![avionics-geoscienti7](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@avionics-geoscienti7](https://community.postman.com/u/avionics-geoscienti7)\
**Post date:** [May 18, 2022, 10:18am UTC](https://community.postman.com/t/newman-returns-successful-despite-failures/35428/1 "2022-05-18T10:18:10Z")

</div>

I have Jenkins running newman. Sometimes, I have some failures in assertions but it still returns a 0 return code (AKA succesful).

This is what it looks like in the console:

```auto
04:48:15 ┌─────────────────────────┬───────────────────────┬───────────────────────┐
04:48:15 │ │ executed │ failed │
04:48:15 ├─────────────────────────┼───────────────────────┼───────────────────────┤
04:48:15 │ iterations │ 1 │ 0 │
04:48:15 ├─────────────────────────┼───────────────────────┼───────────────────────┤
04:48:15 │ requests │ 49 │ 0 │
04:48:15 ├─────────────────────────┼───────────────────────┼───────────────────────┤
04:48:15 │ test-scripts │ 96 │ 0 │
04:48:15 ├─────────────────────────┼───────────────────────┼───────────────────────┤
04:48:15 │ prerequest-scripts │ 52 │ 0 │
04:48:15 ├─────────────────────────┼───────────────────────┼───────────────────────┤
04:48:15 │ assertions │ 74 │ 3 │
04:48:15 ├─────────────────────────┴───────────────────────┴───────────────────────┤
04:48:15 │ total run duration: 16m 57.4s │
04:48:15 ├─────────────────────────────────────────────────────────────────────────┤
04:48:15 │ total data received: 432.76kB (approx) │
04:48:15 ├─────────────────────────────────────────────────────────────────────────┤
04:48:15 │ average response time: 20.6s [min: 159ms, max: 4m 32.2s, s.d.: 1m 4.4s] │
04:48:15 └─────────────────────────────────────────────────────────────────────────┘

```

Even though in the `assertions` row there are 3 failures, it still returns a 0 RC. Is there a way to have it return a non-0 ReturnCode? Some additional flag?

Thanks ahead!

---

<div class="post-metadata">

**Author:** ![jpjpjp](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jpjpjp](https://community.postman.com/u/jpjpjp)\
**Post date:** [November 20, 2024, 10:11pm UTC](https://community.postman.com/t/newman-returns-successful-despite-failures/35428/2 "2024-11-20T22:11:38Z")

</div>

This seems like a reasonable and simple solution (e.g.," have newman return a failure response when tests don’t pass).

I’m surprised that this request from 3 years ago was never answered.

If it’s worth anything, I would also appreciate this, as it would allow for better scripting with Newman.
