Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard against multiple evaluations of before statement #1821

Conversation

@marcphilipp
Copy link
Contributor

marcphilipp commented Nov 10, 2019

Some rules evaluate the base statement multiple times, e.g. to execute
tests repeatedly. The changes made in #1672 led to an exception in such
cases because the MockitoListener was registered multiple times. Now,
we only add the listener the first time the statement is evaluated in
order to restore the old behavior.

Fixes #1767.

Some rules evaluate the base statement multiple times, e.g. to execute
tests repeatedly. The changes made in #1672 led to an exception in such
cases because the `MockitoListener` was registered multiple times. Now,
we only add the listener the first time the statement is evaluated in
order to restore the old behavior.

Fixes #1767.
Copy link
Contributor

TimvdLippe left a comment

That makes sense, thanks for reaching out again and fixing it!!

@TimvdLippe

This comment has been minimized.

Copy link
Contributor

TimvdLippe commented Nov 10, 2019

Oh, this fails a lot of tests 😢 Could it be that testFinished needs the same treatment?

@marcphilipp

This comment has been minimized.

Copy link
Contributor Author

marcphilipp commented Nov 10, 2019

Could it be that testFinished needs the same treatment?

It does indeed. 👍

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Nov 10, 2019

Codecov Report

Merging #1821 into release/3.x will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@                Coverage Diff                @@
##             release/3.x    #1821      +/-   ##
=================================================
+ Coverage          86.71%   86.71%   +<.01%     
  Complexity          2492     2492              
=================================================
  Files                311      311              
  Lines               6549     6551       +2     
  Branches             821      822       +1     
=================================================
+ Hits                5679     5681       +2     
  Misses               674      674              
  Partials             196      196
Impacted Files Coverage Δ Complexity Δ
...ockito/internal/runners/DefaultInternalRunner.java 100% <100%> (ø) 4 <0> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ffc8ae...49e41aa. Read the comment docs.

@TimvdLippe

This comment has been minimized.

Copy link
Contributor

TimvdLippe commented Nov 10, 2019

Awesome thanks!

@TimvdLippe TimvdLippe merged commit d64cbd3 into mockito:release/3.x Nov 10, 2019
3 checks passed
3 checks passed
codecov/patch 100% of diff hit (target 86.71%)
Details
codecov/project 86.71% (+<.01%) compared to 2ffc8ae
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@marcphilipp marcphilipp deleted the marcphilipp:issues/1767-guard-against-multiple-statement-evaluations branch Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.