Skip to content

Commit

Permalink
GEODE-2881: Wait for waitForFlushBeforeExecuteTextSearch to complete
Browse files Browse the repository at this point in the history
	* Test now waits for waitForFlushBeforeExecuteTextSearch initiated by the test hook.
	* The test hook gets called when GII is requested.
	* This task may hit CacheClosedException if the test get completed before the flush operations of GII
  • Loading branch information
nabarunnag committed May 8, 2017
1 parent 3f1482b commit 7030dcd
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.apache.geode.internal.cache.InitialImageOperation;
import org.apache.geode.internal.cache.InitialImageOperation.GIITestHook;
import org.apache.geode.internal.cache.InitialImageOperation.GIITestHookType;
import org.apache.geode.internal.cache.PartitionedRegion;
import org.apache.geode.test.dunit.SerializableRunnableIF;
import org.apache.geode.test.junit.categories.DistributedTest;

Expand Down Expand Up @@ -150,9 +151,20 @@ public void run() {
});
});


dataStore2.invoke(() -> initDataStore(createIndex, regionTestType));

assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 30000));

dataStore2.invoke(() -> {
PartitionedRegion region = (PartitionedRegion) getCache().getRegion(REGION_NAME);
Awaitility.await().atMost(1, TimeUnit.MINUTES)
.until(() -> assertEquals(0, region.getPrStats().getLowRedundancyBucketCount()));
});

dataStore1.invoke(() -> getCache().close());

assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore2, 30000));
executeTextSearch(accessor, "world", "text", NUM_BUCKETS);
}

Expand Down

0 comments on commit 7030dcd

Please sign in to comment.