Feature - Add 'Retry Attribute' to repeat test upon failure

Bug #1039415 reported by benny meade
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
NUnit Framework
Triaged
Wishlist
Unassigned

Bug Description

This issue is now being tracked on Github: https://github.com/nunit/nunit/issues/585

Add an Test attribute for 'Retry'.

* The Retry Attribute would be called when a test fails.
* User can set x number of times to retry test before setting results as Fail
* Otherwise the test will Pass on x number run

Similar code has been written as custom Test Attributes here:

http://devnet.jetbrains.net/thread/304906;jsessionid=5EE80250F865E6167CACC8147C532B4E?tstart=-1
and
http://trishkhoo.com/2011/07/giving-tests-a-second-chance/

(Please note that I'm am only referencing this example code, I did not write it, and don't deserve any credit : )

You would make my team and I very happy testers to see this as part of version 3.0!
Keep up the great work.

Revision history for this message
Charlie Poole (charlie.poole) wrote :

Thanks for filing the bug. This has been discussed in the past but nobody documented it in the bug system.

Note to Implementors:

Do NOT use the code in the linked examples. These are for MbUnit won't work for us. In addition, MbUnit's license is not compatible with NUnit's, so we couldn't use their code legally - at least as far as I know. (Not a lawyer, so I'm being conservative about this.)

Changed in nunit-3.0:
status: New → Triaged
importance: Undecided → Critical
importance: Critical → Medium
tags: added: feature framework
Changed in nunit-3.0:
importance: Medium → Wishlist
Revision history for this message
Peter (peter2049) wrote :

I would also like to request this feature. I have read the multiple discussions of this feature on the internet and realize that most of the comments seem to suggest that the tests should be improved. While I agree with the general consensus I also realize that having this feature will greatly improve my ability to focus on issues which fail constantly as opposed to intermittent failures. Changing the existing code used for all the tests would be a very tedious job which would not be practical for me at the moment.

Revision history for this message
Charlie Poole (charlie.poole) wrote :

@Peter: The feature is accepted for NUnit 3.0 but won't be worked till after existing 2.x features (that we are keeping) are done.

Revision history for this message
Tristan (tristanworley) wrote :

I was looking for this as a feature and found someone has made a plugin with it.
https://github.com/slvnperron/NUnit-retry

Revision history for this message
Charlie Poole (charlie.poole) wrote :

We no longer track issues here, but I noticed your suggestion and also saw that this had never been entered into our issue base on GitHub. I entered it and you can track it there.

Since NUnit 3.0 has a completely different internal design and doesn't support old-style addins, we can't use the plugin directly but we can use its external interface as a source of ideas.

description: updated
tags: added: github
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.