Improve test. All exceptions get logged in all cases by LTC.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1150718 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2011-07-25 14:26:01 +00:00
parent b6c1db99d3
commit c2df0c51b6
1 changed files with 64 additions and 76 deletions

View File

@ -84,7 +84,6 @@ public class TestRealTimeGet extends SolrTestCaseJ4 {
long committedModelClock;
volatile int lastId;
final String field = "val_l";
volatile Throwable ex;
@Test
public void testStressGetRealtime() throws Exception {
@ -118,7 +117,6 @@ public class TestRealTimeGet extends SolrTestCaseJ4 {
@Override
public void run() {
try {
while (operations.get() > 0) {
int oper = rand.nextInt(100);
int id = rand.nextInt(ndocs);
@ -170,10 +168,6 @@ public class TestRealTimeGet extends SolrTestCaseJ4 {
lastId = id;
}
}
} catch (Throwable e) {
ex = e;
SolrException.log(log,e);
}
}
};
@ -187,7 +181,6 @@ public class TestRealTimeGet extends SolrTestCaseJ4 {
@Override
public void run() {
try {
while (operations.decrementAndGet() >= 0) {
int oper = rand.nextInt(100);
// bias toward a recently changed doc
@ -214,6 +207,7 @@ public class TestRealTimeGet extends SolrTestCaseJ4 {
sreq = req("wt","json", "q","id:"+Integer.toString(id), "omitHeader","true");
}
try {
String response = h.query(sreq);
Map rsp = (Map)ObjectBuilder.fromJSON(response);
List doclist = (List)(((Map)rsp.get("response")).get("docs"));
@ -224,13 +218,10 @@ public class TestRealTimeGet extends SolrTestCaseJ4 {
long foundVal = (Long)(((Map)doclist.get(0)).get(field));
assertTrue(foundVal >= Math.abs(val));
}
} catch (Exception e) {
fail(e.toString());
}
}
catch (Throwable e) {
ex = e;
operations.set(-1L);
SolrException.log(log,e);
}
}
};
@ -245,9 +236,6 @@ public class TestRealTimeGet extends SolrTestCaseJ4 {
for (Thread thread : threads) {
thread.join();
}
assertNull(ex);
}
}