Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

NUnit3 Retry attribute
Grendil
#1 Posted : Thursday, September 14, 2017 5:12:20 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 3/18/2017(UTC)
Posts: 54
Location: United States of America

Thanks: 22 times
Was thanked: 11 time(s) in 10 post(s)
We're looking at using NUnit3's Retry attribute to retry some flaky specflow tests. I'm wondering how this will work with NCrunch (including the console version) and if there is any better way to get NCrunch to retry flaky tests.

Also, we may have to write a custom NUnit Retry attribute to expand the behavior of the normal one (something along the lines of this post: https://testingrepositor...y-failed-tests-in-nunit) so I'm also wondering if NCrunch would properly handle any NUnit attributes like these.
Remco
#2 Posted : Thursday, September 14, 2017 11:20:29 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
In theory, the logic of this attribute should be handled internally by NUnit and shouldn't require any involvement from NCrunch. I can't say that I've specifically tested it, but I can't tell you any reason why it wouldn't work. I recommend giving it a try.

Again, in theory, I can't think of anything that would prevent you from writing your own extended version of RetryAttribute. As long as NUnit's code picked this up and invoked it in the same way as the normal RetryAttribute, there is a good chance it will work. I am a little less certain of this one in the sense that extending NUnit in the past hasn't always worked out so well for NCrunch, because it steps into untested behaviour.

This is all under the assumption that you're doing this in NUnit V3.
1 user thanked Remco for this useful post.
Grendil on 9/15/2017(UTC)
Grendil
#3 Posted : Friday, September 15, 2017 4:43:03 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 3/18/2017(UTC)
Posts: 54
Location: United States of America

Thanks: 22 times
Was thanked: 11 time(s) in 10 post(s)
Great, that's just the feedback I was looking for, thanks. I think we'll give it a try.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.024 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download