Running integration tests with different JUnit runners

(Wim Van Leuven) #1

I've been trying to write an integration test against elasticsearch transport client using ESIntegTestCase or against a dockerized ES cluster or spinning up an internaltestcluster.

All attempts failed with IllegalStateExceptions that are triggered by the randomization code in there. It seems that the transport client detects it is running in a test environment and changes behaviour forcing the code to run under a RandomizedRunner.

I think the ES test framework should not force this requirement.
(I need another running as our apps are build on Spring which require another runner for dependency injection.)

What would the most suitable workaround be?

Thanks in advance!

(Jason Tedor) #2

Our test framework relies on randomization. For randomization to be useful in testing, it must be repeatable. Therefore, we have guards against using non-repeatable randomness in tests. If you do not want to be subject to this requirement, I think that you should not use ESIntegTestCase. Alternatively, you're only subject to this requirement if randomized runner is on the classpath so you could try removing it but of course there are things that will be broken like any of the random methods in the test framework which might be invoked on you indirectly.

(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.