Skip to content

Commit

Permalink
GEODE-5943: cleanup vm before each test (#2889)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinmeiliao authored Nov 22, 2018
1 parent 5f53d53 commit 3a3697d
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;

import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -84,6 +85,7 @@ public void before() {
if (offHeap) {
properties.setProperty(OFF_HEAP_MEMORY_SIZE, "200m");
}

server0 = cluster.startServerVM(0, s -> s.withNoCacheServer()
.withProperties(properties).withConnectionToLocator(locatorPort));
server1 = cluster.startServerVM(1, s -> s.withNoCacheServer()
Expand All @@ -102,6 +104,14 @@ public void before() {
}, server0, server1);
}

@After
public void tearDown() throws Exception {
// this test is asserting on the expected number of evictions depending on the current memory
// usage, so we need to make sure each test start with clean memory usage to reduce flakiness
server0.getVM().bounce();
server1.getVM().bounce();
}

@Test
public void testDummyInlineNCentralizedEviction() {
VMProvider.invokeInEveryMember("create region", () -> {
Expand Down

0 comments on commit 3a3697d

Please sign in to comment.