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


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

Re: Mockito test are unstable

Path csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Cecil Westerhof <Cecil@decebal.nl>
Newsgroups comp.lang.java.programmer
Subject Re: Mockito test are unstable
Date Tue, 03 Nov 2015 19:32:39 +0100
Organization Decebal Computing
Lines 24
Message-ID <87r3k7hr20.fsf@Equus.decebal.nl> (permalink)
References <87h9l4k8re.fsf@Equus.decebal.nl> <slrnn3h26q.jg7.avl@login.logic.tuwien.ac.at>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mx02.eternal-september.org; posting-host="528adfd6ad074c92fdc6a7f8fb9e23d8"; logging-data="27985"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18OMP8ZZlgpOZWDfgrI5/byuHGwhlGLji4="
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
X-Homepage http://www.decebal.nl/
Cancel-Lock sha1:Ek8tkDyW/CmkiJxYK64FaBUdeKE= sha1:rU+0vin1jQVLBHp0qQtG0c7VHqk=
Xref csiph.com comp.lang.java.programmer:32987

Show key headers only | 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