elasticsearch-java icon indicating copy to clipboard operation
elasticsearch-java copied to clipboard

Using randomized testing in project

Open spinscale opened this issue 3 years ago • 1 comments

Elasticsearch is a big user of randomized testing. The library however features a lot more, like thread leak detection in test cases. So a test suite fails, if a thread is kept running - for more info check the annotation party in ESTestCase.

If you stick with junit4, this might make sense, if you upgrade to junit jupiter, I don't think there is a port just yet due to changes in the test infrastructure.

spinscale avatar Oct 13 '21 08:10 spinscale

Actually we do already have some early bits of random testing in JSON serialization tests since we have the Jackson and JSON-B implementations.

It makes sense to use something more robust and off-the shelf and extend it to all tests. I'm not sure though that advanced features like thread leak detection are important in the context of this library (all thread management is done in the http libraries), so maybe some Junit5 extension could do the job too? Provided of course it makes it easy to set the seed to reproduct a test.

swallez avatar Oct 18 '21 10:10 swallez