Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #32987

Re: Mockito test are unstable

From Cecil Westerhof <Cecil@decebal.nl>
Newsgroups comp.lang.java.programmer
Subject Re: Mockito test are unstable
Date 2015-11-03 19:32 +0100
Organization Decebal Computing
Message-ID <87r3k7hr20.fsf@Equus.decebal.nl> (permalink)
References <87h9l4k8re.fsf@Equus.decebal.nl> <slrnn3h26q.jg7.avl@login.logic.tuwien.ac.at>

Show all headers | View raw


On Tuesday  3 Nov 2015 11:11 CET, Andreas Leitgeb wrote:

> Cecil Westerhof <Cecil@decebal.nl> wrote:
>> I am working on an old project where they are using Mockito for
>> unit testing. The strange problem we have is that when mvn is run
>> several times every time different tests are failing. And sometime
>> no tests are failing. Anyone an idea what could be the problem?
>
> I don't know Mockito, but when tests are flaky then probably the
> tests themselves have Heisenbugs?
>
> E.g.: maybe the tests each depend on & modify static data and thus
> randomly fail when tests are being run concurrently...

I was already for some time telling them that the tests should be
independent of each-other. They where adamant that they where, but at
last they found they where not. At the moment they included an @After
besides the @Before that was already in place to clean things up and
until now the problem has not reappeared. So hopefully problem solved.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Mockito test are unstable Cecil Westerhof <Cecil@decebal.nl> - 2015-11-02 11:15 +0100
  Re: Mockito test are unstable Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2015-11-03 10:11 +0000
    Re: Mockito test are unstable Cecil Westerhof <Cecil@decebal.nl> - 2015-11-03 19:32 +0100

csiph-web