Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
        maxHeapSize '768m'
        jvmArgs = ['-XX:+HeapDumpOnOutOfMemoryError', '-ea']
        systemProperties = [
          'gemfire.DEFAULT_MAX_OPLOG_SIZE' : '10',
          'gemfire.disallowMcastDefaults'  : 'true',
          'jline.terminal'                 : 'jline.UnsupportedTerminal',
        ]

 

Use new await() to wait for an async event to finish

We've introduced com.jayway.awaitility.Awaitility.await in geode. There's a better way to replace our old WaitCriterion. await() can also be used in product code, while WaitCriterion is only in DistributedTestCase. 

 
 

Code Block
              Cache cache = getCache();
              DistributedTestCase.disconnectFromDS();

              await().atMost(30, SECONDS).untilTrue(new AtomicBoolean(cache == null || cache.isClosed()));
is equivalent to:               
              WaitCriterion waitForCacheClose = new WaitCriterion() {
                @Override
                public boolean done() {
                  return cache == null || cache.isClosed();
                }

                @Override
                public String description() {
                  return "Wait for Cache to be closed";
                }
              };
              
              DistributedTestCase.waitForCriterion(waitForCacheClose, 30000, 500, true);