unfinished stubbing - sometimes

433 views
Skip to first unread message

Tomek Kaczanowski

unread,
Jul 6, 2015, 2:36:47 AM7/6/15
to moc...@googlegroups.com
Hi All,

I have a strange issue with my tests. When running on jenkins then maybe 5% of executions of one test ends up with:

org.mockito.exceptions.misusing.UnfinishedStubbingException:
Unfinished stubbing detected here:
-> at SomeClass.someMethod(SomeTest.java:90)

This does not makes much sense to me cause for all other invocations everything works fine. The line when stubbing happens looks good to me (and as I said it works most of time):

doThrow(new InterruptedException()).when(someCollaborator).someVoidMethod();

I was never able to repeat it when running this test locally - with IDE or with maven.

So the question is whether anyone has got similar issue? Any hints on what might be the cause? I'm starting to suspect that its all because of some neutrinos bombarding my CI server. :)

Currently I'm using Mockito 1.9.5 I will try to upgrade to latest beta and see whether it changes anything (meaning: I will run tests over and over again waiting for failure...)

Regards,
Tomek Kaczanowski



Brice Dutheil

unread,
Jul 18, 2015, 11:29:29 AM7/18/15
to moc...@googlegroups.com
weird indeed, are you sure maven version and plugin are correctly set ?

I never encountered such issues.
I you don't rely on powermock and you are ready for API changes, try mockito 2.0.x-beta

-- Brice

--
You received this message because you are subscribed to the Google Groups "mockito" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mockito+u...@googlegroups.com.
To post to this group, send email to moc...@googlegroups.com.
Visit this group at http://groups.google.com/group/mockito.
To view this discussion on the web visit https://groups.google.com/d/msgid/mockito/8235ec8d-7b9b-459b-8374-3fadfe11ece4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages