@Test
  public void resultCollectorHonorsFunctionTimeout() throws InterruptedException {
    Function sleepingFunction = context -> {
      try {
        long endTime = System.nanoTime() + TimeUnit.SECONDS.toNanos(30);
        while (!context.getCache().isClosed() && System.nanoTime() < endTime) {
          Thread.sleep(10);
        }
      } catch (InterruptedException e) {
        // exit
      }
      context.getResultSender().sendResult("FAILED");
    };

    ResultCollector collector = getExecution().execute(sleepingFunction);
    thrown.expect(FunctionException.class);
    collector.getResult(1, TimeUnit.SECONDS);
  }
Test the a result collector will timeout using the timeout provided
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/FunctionServiceBase.java