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

Try to use with parallel test execution (Junit 5) #27

Open
artsok opened this issue May 4, 2019 · 9 comments
Open

Try to use with parallel test execution (Junit 5) #27

artsok opened this issue May 4, 2019 · 9 comments
Assignees

Comments

@artsok
Copy link
Owner

artsok commented May 4, 2019

(Note: This feature is not working when you are using JUnit 5.3.1 parallel test execution feature.)

https://www.swtestacademy.com/junit-5-how-to-repeat-failed-test/

@artsok artsok self-assigned this May 4, 2019
@foxfortune
Copy link

Any update on when you might be able to have the parallel execution work as expected. It is a pretty big need to make this an effective retrier

@artsok
Copy link
Owner Author

artsok commented Jan 15, 2020

Hey! I was investigating time to implement this feature - but I haven't already found a solution. All parallel execution behind the science (deep in JUnit core). I will try to research the solution else in February. Now I don't have free time.

@foxfortune
Copy link

foxfortune commented Jan 16, 2020

Thanks! Someone else on my team came up with a solution that works, if you simply add the following annotation to all parallel tests it will run in parallel as expected!
@ResourceLock(value = SYSTEM_PROPERTIES, mode = READ_WRITE)

This does have some limitations as it means any repeated test will only run in serial, the upside is that any test that is not repeated or a normal parameterized test will run in parallel, so better than nothing however still a ways to go to get full parallelization.

@artsok
Copy link
Owner Author

artsok commented Jan 16, 2020

https://github.com/Tofel/rerunner-jupiter/commit/eebd2ecc084906335575221875ec39ed2e956bef

This man implements parallel test execution. Will grab it or @foxfortune you can do it.

@foxfortune
Copy link

I pulled it down and tried testing it locally but I still see the tests not retrying and only running once when running in parallel. I sent Tofel an email to see if there is something I am missing...

@yaandy
Copy link

yaandy commented Apr 6, 2020

Hi, did you manage to handle this issue? In my case, it works for parallel tests execution on version 2.1.3 but at some point, it stops and In case of fail I get 1 run in status skipped.
I don't have a clue why because nothing related to rerun or JUnit config was changed.
I try to debug Gradle build and looks like TestExecutionExceptionHandler is not invoked in case of failure.

@yaandy
Copy link

yaandy commented Apr 6, 2020

Tofel@eebd2ec

This man implements parallel test execution. Will grab it or @foxfortune you can do it.

This fork behaves the same for concurrent tests in my case. (only one run in case of failure in status skipped).

For both rerunner impl annotating class that contains @RepeatedIfExceptionsTest with :
@ResourceLock(value = SYSTEM_PROPERTIES, mode = READ_WRITE)
or
@execution(ExecutionMode.SAME_THREAD)
or setting properties
systemProperties['junit.jupiter.execution.parallel.mode.default'] = 'same_thread'
systemProperties['junit.jupiter.execution.parallel.mode.classes.default'] = 'concurrent'

helps to resolve, so you should force to run all tests within the class in the same thread.

@benhubert
Copy link

The mentioned fork is not available anymore. Is there any chance that this library will support concurrent execution soon?

@ThakkarChandresh
Copy link

Is there any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants