Skip to content

Commit

Permalink
#50 Knock down a few long tail tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
markrmiller committed Jul 10, 2020
1 parent f043930 commit 8e78a87
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void test() throws Exception {
oddField, "odd eggs"
);

for (int i = 100; i < (TEST_NIGHTLY ? 150 : 25); i++) {
for (int i = 100; i < (TEST_NIGHTLY ? 150 : 5); i++) {
indexr(id, i);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ protected void queryPartialResults(final List<String> upShards,
if (stress > 0) {
log.info("starting stress...");
Set<Future<Object>> pending = new HashSet<>();;
ExecutorCompletionService<Object> cs = new ExecutorCompletionService<>(executor);
ExecutorCompletionService<Object> cs = new ExecutorCompletionService<>(testExecutor);
Callable[] threads = new Callable[nThreads];
for (int i = 0; i < threads.length; i++) {
threads[i] = new Callable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void testEveryIsolatedSortFieldOnSingleGroup() throws Exception {

public void testRandomCollpaseWithSort() throws Exception {

final int numMainQueriesPerCollapseField = atLeast(TEST_NIGHTLY ? 5 : 3);
final int numMainQueriesPerCollapseField = atLeast(TEST_NIGHTLY ? 5 : 2);

for (String collapseField : ALL_COLLAPSE_FIELD_NAMES) {
for (int i = 0; i < numMainQueriesPerCollapseField; i++) {
Expand All @@ -140,7 +140,7 @@ public void testRandomCollpaseWithSort() throws Exception {
final SolrParams mainP = params("q", q, "fl", "id,"+collapseField);

final String csize = random().nextBoolean() ?
"" : " size=" + TestUtil.nextInt(random(),1,TEST_NIGHTLY ? 10000 : 1000);
"" : " size=" + TestUtil.nextInt(random(),1,TEST_NIGHTLY ? 10000 : 10);

final String nullPolicy = randomNullPolicy();
final String nullPs = NULL_IGNORE.equals(nullPolicy)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public static void buildIndexes(final List<SolrClient> clients, final String sta
}

// really long tail uncommon foo_s terms on shard2
for (int i = 0; i < 30; i++) {
for (int i = 0; i < (TEST_NIGHTLY ? 30 : 10); i++) {
// NOTE: using "Z" here so these sort before bbb0 when they tie for '1' instance each on shard2
shard2.add(sdoc("id", docNum.incrementAndGet(), "foo_s", "ZZZ"+i));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,6 @@
*/
public abstract class BaseDistributedSearchTestCase extends SolrTestCaseJ4 {

protected ExecutorService executor = new ExecutorUtil.MDCAwareThreadPoolExecutor(
4,
Integer.MAX_VALUE,
15, TimeUnit.SECONDS, // terminate idle threads after 15 sec
new SynchronousQueue<>(), // directly hand off tasks
new SolrNamedThreadFactory("BaseDistributedSearchTestCase"),
false
);

// TODO: this shouldn't be static. get the random when you need it to avoid sharing.
public static Random r;

Expand Down Expand Up @@ -337,7 +328,6 @@ public void distribSetUp() throws Exception {

private volatile boolean distribTearDownCalled = false;
public void distribTearDown() throws Exception {
ExecutorUtil.shutdownAndAwaitTermination(executor);
distribTearDownCalled = true;
}

Expand Down Expand Up @@ -417,10 +407,7 @@ protected void destroyServers() throws Exception {
// if (destroyServersCalled) throw new RuntimeException("destroyServers already called");
// destroyServersCalled = true;
try (ParWork closer = new ParWork(this, true)) {

closer.add("clients", controlClient, clients);

closer.add("jetties", jettys, controlJetty);
closer.add("jetties&clients", controlClient, clients, jettys, controlJetty);
}

clients.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public static void setupTestCases() {
resetExceptionIgnores();

testExecutor = new ExecutorUtil.MDCAwareThreadPoolExecutor(0, Integer.MAX_VALUE,
15L, TimeUnit.SECONDS,
5L, TimeUnit.SECONDS,
new SynchronousQueue<>(),
new SolrNamedThreadFactory("testExecutor"),
true);
Expand Down

0 comments on commit 8e78a87

Please sign in to comment.