tests: only add a delete if the doc add did not fail

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1427618 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2013-01-02 01:26:04 +00:00
parent fc4ed67dc2
commit 6b6d1f65c2
1 changed files with 3 additions and 1 deletions

View File

@ -1156,6 +1156,7 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTes
while (true && !stop) {
++i;
boolean addFailed = false;
if (doDeletes && random().nextBoolean() && deletes.size() > 0) {
Integer delete = deletes.remove(0);
@ -1179,6 +1180,7 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTes
indexr(id, i, i1, 50, tlong, 50, t1,
"to come to the aid of their country.");
} catch (Exception e) {
addFailed = true;
System.err.println("REQUEST FAILED:");
e.printStackTrace();
if (e instanceof SolrServerException) {
@ -1188,7 +1190,7 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTes
fails.incrementAndGet();
}
if (doDeletes && random().nextBoolean()) {
if (!addFailed && doDeletes && random().nextBoolean()) {
deletes.add(i);
}