There is some delay in the elasticsearch search from requesting indexing of a document so that the document becomes searchable. I want to know how to handle this in unit test, for example, indexing a document first, and then checking if it is actually indexed. Now I just use the Thread.sleep () call to delay some time (I use a simple junit class), say 2 seconds. This is normal? Or are there better solutions?
unit-testing elasticsearch delay
D_S_toowhite
source share