Test: Make update-by-query test more resilient

`UpdateByQueryWhileModifyingTests#testUpdateWhileReindexing`
runs update-by-query and concurrently updates, asserting that
the update-by-query never reverts any changes made by the update.
It is a smoke test for concurrent updates.

Now, it expects to hit a certain number of version conflicts
during the updates. This is normal as it is racing the
update-by-query. We have a maximum number of failures we
expect (10) and I'd never seen us come close until
https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+5.x+multijob-unix-compatibility/os=sles/495/console

This bumps the max failures from 10 to 50 and improves
logging a bit. If we continue to see this failure then we have
some other issue.

Closes #22938
This commit is contained in:
Nik Everett 2017-02-03 08:00:57 -05:00
parent 01871e4def
commit ea4eb06b0a
1 changed files with 3 additions and 4 deletions

View File

@ -39,7 +39,7 @@ import static org.hamcrest.Matchers.equalTo;
*/
public class UpdateByQueryWhileModifyingTests extends ReindexTestCase {
private static final int MAX_MUTATIONS = 50;
private static final int MAX_ATTEMPTS = 10;
private static final int MAX_ATTEMPTS = 50;
public void testUpdateWhileReindexing() throws Exception {
AtomicReference<String> value = new AtomicReference<>(randomSimpleString(random()));
@ -83,9 +83,8 @@ public class UpdateByQueryWhileModifyingTests extends ReindexTestCase {
throw new RuntimeException(
"Failed to index after [" + MAX_ATTEMPTS + "] attempts. Too many version conflicts!");
}
logger.info(
"Caught expected version conflict trying to perform mutation number {} with version {}. Retrying.",
i, get.getVersion());
logger.info("Caught expected version conflict trying to perform mutation number [{}] with version [{}] "
+ "on attempt [{}]. Retrying.", i, get.getVersion(), attempts);
get = client().prepareGet("test", "test", "test").get();
}
}