This is an automated email from the ASF dual-hosted git repository.
wirebaron pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push:
new 1fe80a9 GEODE-1009: remove flakiness from testAllOpsNotifications by
handling… (#2127)
1fe80a9 is described below
commit 1fe80a986813def8d2696c6c8b5de77a54c567a9
Author: Brian Rowe <[email protected]>
AuthorDate: Wed Jul 25 10:31:55 2018 -0700
GEODE-1009: remove flakiness from testAllOpsNotifications by handling…
(#2127)
---
.../java/org/apache/geode/security/SecurityTestUtils.java | 11 ++++++++++-
.../geode/security/ClientPostAuthorizationDUnitTest.java | 3 ---
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git
a/geode-core/src/distributedTest/java/org/apache/geode/security/SecurityTestUtils.java
b/geode-core/src/distributedTest/java/org/apache/geode/security/SecurityTestUtils.java
index 8477423..93bca0c 100644
---
a/geode-core/src/distributedTest/java/org/apache/geode/security/SecurityTestUtils.java
+++
b/geode-core/src/distributedTest/java/org/apache/geode/security/SecurityTestUtils.java
@@ -68,6 +68,7 @@ import org.apache.geode.cache.Cache;
import org.apache.geode.cache.CacheFactory;
import org.apache.geode.cache.DataPolicy;
import org.apache.geode.cache.DynamicRegionFactory;
+import org.apache.geode.cache.EntryDestroyedException;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.RegionAttributes;
import org.apache.geode.cache.Scope;
@@ -663,7 +664,15 @@ public class SecurityTestUtils {
protected static Object getLocalValue(final Region region, final Object key)
{
Region.Entry entry = region.getEntry(key);
- return (entry != null ? entry.getValue() : null);
+ if (entry != null) {
+ try { // Handle race conditions with concurrent destroy ops
+ return entry.getValue();
+ } catch (EntryDestroyedException e) {
+ return null;
+ }
+ } else {
+ return null;
+ }
}
protected static void doProxyCacheClose() {
diff --git
a/geode-cq/src/distributedTest/java/org/apache/geode/security/ClientPostAuthorizationDUnitTest.java
b/geode-cq/src/distributedTest/java/org/apache/geode/security/ClientPostAuthorizationDUnitTest.java
index 0da7d45..1d1ca25 100644
---
a/geode-cq/src/distributedTest/java/org/apache/geode/security/ClientPostAuthorizationDUnitTest.java
+++
b/geode-cq/src/distributedTest/java/org/apache/geode/security/ClientPostAuthorizationDUnitTest.java
@@ -31,7 +31,6 @@ import
org.apache.geode.cache.operations.OperationContext.OperationCode;
import org.apache.geode.internal.AvailablePortHelper;
import org.apache.geode.security.generator.AuthzCredentialGenerator;
import org.apache.geode.security.generator.CredentialGenerator;
-import org.apache.geode.test.junit.categories.FlakyTest;
import org.apache.geode.test.junit.categories.SecurityTest;
/**
@@ -112,8 +111,6 @@ public class ClientPostAuthorizationDUnitTest extends
ClientAuthorizationTestCas
}
}
- // GEODE-1009: random ports, uses Random, time sensitive, waitForCondition
(waitForCriterion)
- @Category(FlakyTest.class)
@Test
public void testAllOpsNotifications() throws Exception {
OperationWithAction[] allOps = allOpsForTestAllOpsNotifications();