@Test
  public void testQueryMonitorRegionWithEviction() throws Exception {
    File server1WorkingDir = server1.getWorkingDir();
    File server2WorkingDir = server2.getWorkingDir();
    server1.invoke(() -> createReplicateRegionWithEviction(server1WorkingDir));
    server2.invoke(() -> createReplicateRegionWithEviction(server2WorkingDir));
    server1.invoke(() -> populateRegion(0, 100));
    server2.invoke(() -> populateRegion(100, 200));

    // client3 connects to server1, client4 connects to server2
    int server1Port = server1.getPort();
    int server2Port = server2.getPort();
    client3 = cluster.startClientVM(3, new Properties(), ccf -> {
      configureClientCacheFactory(ccf, server1Port);
    });

    client4 = cluster.startClientVM(4, new Properties(), ccf -> {
      configureClientCacheFactory(ccf, server2Port);
    });
    client3.invoke(QueryMonitorDUnitTest::executeQueries);
    client4.invoke(QueryMonitorDUnitTest::executeQueries);
  }
These tests add a test hook to make sure query execution sleeps for at least 20 ms, so the
queryMonitor thread will get a chance to cancel the query before it completes.

The MAX_QUERY_EXECUTION_TIME is set as 1 ms, i.e, theoretically all queries will be cancelled
after 1ms, but due to thread scheduling, this may not be true. we can only decrease the flakyness
of the test by making MAX_QUERY_EXECUTION_TIME the smallest possible (1) and making the query
execution time longer (but not too long to make the test run too slow).
geode-cq/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryMonitorDUnitTest.java