Author: thomasm
Date: Wed Feb 22 15:00:24 2017
New Revision: 1784028
URL: http://svn.apache.org/viewvc?rev=1784028&view=rev
Log:
OAK-5388 Test failure: persistentCache.BroadcastTest.broadcastTCP
Modified:
jackrabbit/oak/branches/1.4/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/persistentCache/BroadcastTest.java
Modified:
jackrabbit/oak/branches/1.4/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/persistentCache/BroadcastTest.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.4/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/persistentCache/BroadcastTest.java?rev=1784028&r1=1784027&r2=1784028&view=diff
==============================================================================
---
jackrabbit/oak/branches/1.4/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/persistentCache/BroadcastTest.java
(original)
+++
jackrabbit/oak/branches/1.4/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/persistentCache/BroadcastTest.java
Wed Feb 22 15:00:24 2017
@@ -202,14 +202,14 @@ public class BroadcastTest {
int correct = 0;
for (int i = 0; i < 50; i++) {
c1.put(k, new StringValue("Hello World " + i));
- waitFor(c2, k, 100);
+ waitFor(c2, k, 10000);
StringValue v2 = c2.getIfPresent(k);
if (v2 != null && v2.toString().equals("Hello World " + i)) {
correct++;
}
c2.invalidate(k);
assertNull(c2.getIfPresent(k));
- waitFor(c1, k, null, 100);
+ waitFor(c1, k, null, 10000);
StringValue v1 = c1.getIfPresent(k);
if (v1 == null) {
correct++;
@@ -221,7 +221,7 @@ public class BroadcastTest {
correct >= minPercentCorrect);
}
- private static boolean waitFor(Callable<Boolean> call, int timeout) {
+ private static boolean waitFor(Callable<Boolean> call, int
timeoutInMilliseconds) {
long start = System.currentTimeMillis();
while (true) {
try {
@@ -237,13 +237,13 @@ public class BroadcastTest {
} catch (Exception e) {
throw new AssertionError(e);
}
- if (time > timeout) {
+ if (time > timeoutInMilliseconds) {
return false;
}
}
}
- private static <K, V> boolean waitFor(final Cache<K, V> map, final K key,
final V value, int timeout) {
+ private static <K, V> boolean waitFor(final Cache<K, V> map, final K key,
final V value, int timeoutInMilliseconds) {
return waitFor(new Callable<Boolean>() {
@Override
public Boolean call() {
@@ -253,16 +253,16 @@ public class BroadcastTest {
}
return value.equals(v);
}
- }, timeout);
+ }, timeoutInMilliseconds);
}
- private static <K, V> boolean waitFor(final Cache<K, V> map, final K key,
int timeout) {
+ private static <K, V> boolean waitFor(final Cache<K, V> map, final K key,
int timeoutInMilliseconds) {
return waitFor(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return map.getIfPresent(key) != null;
}
- }, timeout);
+ }, timeoutInMilliseconds);
}
private static Cache<PathRev, StringValue> openCache(PersistentCache p) {