@Test
  public void entriesShouldNotExpireDuringGII() throws Exception {
    AsyncInvocation<Void> doRegionOps = otherVM.invokeAsync(this::doRegionOps);

    RegionFactory<String, String> regionFactory =
        cacheRule.getOrCreateCache().createRegionFactory(REPLICATE);
    regionFactory.addCacheListener(new SlowGiiCacheListener());
    regionFactory.setEntryIdleTimeout(new ExpirationAttributes(1, INVALIDATE));
    regionFactory.setStatisticsEnabled(true);

    Region<String, String> region = regionFactory.create(REGION_NAME);

    doRegionOps.await();

    await().until(() -> region.values().isEmpty());

    assertThat(region.values()).hasSize(0);
    assertThat(region.keySet()).hasSize(ENTRY_COUNT);
    assertThat(expirationCount.get()).isGreaterThanOrEqualTo(ENTRY_COUNT);
  }
Entries should not expire during GII

<p>
TRAC #35214: hang during getInitialImage due to entry expiration

@since GemFire 5.0
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/EntriesDoNotExpireDuringGiiRegressionTest.java