You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2018/04/06 16:22:02 UTC

[geode] branch develop updated (a6a7275 -> 76dd7e2)

This is an automated email from the ASF dual-hosted git repository.

klund pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git.


    from a6a7275  GEODE-5021: Add parameters to connection in jdbc-1.0.xsd (#1748)
     new a956147  GEODE-1279: Rename FinalStaticArrayShouldNotCauseSegFaultRegressionTest
     new 76dd7e2  GEODE_1279: Rename MembershipAttributesAreSerializableRegressionTest

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ...ArrayShouldNotCauseSegFaultRegressionTest.java} | 55 +++++++++++-----------
 ...ipAttributesAreSerializableRegressionTest.java} | 30 +++++++-----
 2 files changed, 46 insertions(+), 39 deletions(-)
 rename geode-core/src/test/java/org/apache/geode/cache/{FinalStaticArrayShouldNotCauseSegFaultTest.java => FinalStaticArrayShouldNotCauseSegFaultRegressionTest.java} (60%)
 rename geode-core/src/test/java/org/apache/geode/cache/{MembershipAttributesAreSerializableTest.java => MembershipAttributesAreSerializableRegressionTest.java} (75%)

-- 
To stop receiving notification emails like this one, please contact
klund@apache.org.

[geode] 02/02: GEODE_1279: Rename MembershipAttributesAreSerializableRegressionTest

Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

klund pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 76dd7e22826a1d51e05e9b451e104e05204188ff
Author: Kirk Lund <kl...@apache.org>
AuthorDate: Wed Apr 4 10:45:18 2018 -0700

    GEODE_1279: Rename MembershipAttributesAreSerializableRegressionTest
---
 ...ipAttributesAreSerializableRegressionTest.java} | 30 +++++++++++++---------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/geode-core/src/test/java/org/apache/geode/cache/MembershipAttributesAreSerializableTest.java b/geode-core/src/test/java/org/apache/geode/cache/MembershipAttributesAreSerializableRegressionTest.java
similarity index 75%
rename from geode-core/src/test/java/org/apache/geode/cache/MembershipAttributesAreSerializableTest.java
rename to geode-core/src/test/java/org/apache/geode/cache/MembershipAttributesAreSerializableRegressionTest.java
index 00fb577..298c7a7 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/MembershipAttributesAreSerializableTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/MembershipAttributesAreSerializableRegressionTest.java
@@ -14,7 +14,7 @@
  */
 package org.apache.geode.cache;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -31,7 +31,7 @@ import org.apache.geode.test.junit.categories.UnitTest;
  * Tests MembershipAttributes and SubscriptionAttributes to make sure they are Serializable
  */
 @Category({UnitTest.class, MembershipTest.class})
-public class MembershipAttributesAreSerializableTest {
+public class MembershipAttributesAreSerializableRegressionTest {
 
   /**
    * Assert that MembershipAttributes are serializable.
@@ -40,16 +40,19 @@ public class MembershipAttributesAreSerializableTest {
   public void testMembershipAttributesAreSerializable() throws Exception {
     String[] roles = {"a", "b", "c"};
     MembershipAttributes outMA = new MembershipAttributes(roles);
+
     ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
-    ObjectOutputStream oos = new ObjectOutputStream(baos);
-    oos.writeObject(outMA);
+    try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
+      oos.writeObject(outMA);
+    }
 
     byte[] data = baos.toByteArray();
 
     ByteArrayInputStream bais = new ByteArrayInputStream(data);
-    ObjectInputStream ois = new ObjectInputStream(bais);
-    MembershipAttributes inMA = (MembershipAttributes) ois.readObject();
-    assertEquals(outMA, inMA);
+    try (ObjectInputStream ois = new ObjectInputStream(bais)) {
+      MembershipAttributes inMA = (MembershipAttributes) ois.readObject();
+      assertEquals(outMA, inMA);
+    }
   }
 
   /**
@@ -58,15 +61,18 @@ public class MembershipAttributesAreSerializableTest {
   @Test
   public void testSubscriptionAttributesAreSerializable() throws Exception {
     SubscriptionAttributes outSA = new SubscriptionAttributes();
+
     ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
-    ObjectOutputStream oos = new ObjectOutputStream(baos);
-    oos.writeObject(outSA);
+    try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
+      oos.writeObject(outSA);
+    }
 
     byte[] data = baos.toByteArray();
 
     ByteArrayInputStream bais = new ByteArrayInputStream(data);
-    ObjectInputStream ois = new ObjectInputStream(bais);
-    SubscriptionAttributes inSA = (SubscriptionAttributes) ois.readObject();
-    assertEquals(outSA, inSA);
+    try (ObjectInputStream ois = new ObjectInputStream(bais)) {
+      SubscriptionAttributes inSA = (SubscriptionAttributes) ois.readObject();
+      assertEquals(outSA, inSA);
+    }
   }
 }

-- 
To stop receiving notification emails like this one, please contact
klund@apache.org.

[geode] 01/02: GEODE-1279: Rename FinalStaticArrayShouldNotCauseSegFaultRegressionTest

Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

klund pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git

commit a956147cc8dafa456da4f7b41e97ae4dd60327f6
Author: Kirk Lund <kl...@apache.org>
AuthorDate: Wed Apr 4 10:40:59 2018 -0700

    GEODE-1279: Rename FinalStaticArrayShouldNotCauseSegFaultRegressionTest
---
 ...ArrayShouldNotCauseSegFaultRegressionTest.java} | 55 +++++++++++-----------
 1 file changed, 28 insertions(+), 27 deletions(-)

diff --git a/geode-core/src/test/java/org/apache/geode/cache/FinalStaticArrayShouldNotCauseSegFaultTest.java b/geode-core/src/test/java/org/apache/geode/cache/FinalStaticArrayShouldNotCauseSegFaultRegressionTest.java
similarity index 60%
rename from geode-core/src/test/java/org/apache/geode/cache/FinalStaticArrayShouldNotCauseSegFaultTest.java
rename to geode-core/src/test/java/org/apache/geode/cache/FinalStaticArrayShouldNotCauseSegFaultRegressionTest.java
index e84b655..b83ea0f 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/FinalStaticArrayShouldNotCauseSegFaultTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/FinalStaticArrayShouldNotCauseSegFaultRegressionTest.java
@@ -26,8 +26,6 @@ import org.junit.experimental.categories.Category;
 import org.apache.geode.test.junit.categories.UnitTest;
 
 /**
- * Test case for Trac <a href="https://svn.gemstone.com/trac/gemfire/ticket/52289">#52289</a>.
- *
  * Asserts fixes for bug JDK-8076152 in JDK 1.8.0u20 to 1.8.0.u45.
  * http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8076152
  *
@@ -38,45 +36,48 @@ import org.apache.geode.test.junit.categories.UnitTest;
  * This test and its corrections can be removed after the release of JDK 1.8.0u60 if we choose to
  * not support 1.8.0u20 - 1.8.0u45 inclusive.
  *
+ * <p>
+ * TRAC #52289: HotSpot SIGSEGV in C2 CompilerThread1 (LoadNode::Value(PhaseTransform*) const+0x202)
+ * with JDK 1.8.0_45
+ *
  * @since GemFire 8.2
  */
 @Category(UnitTest.class)
-public class FinalStaticArrayShouldNotCauseSegFaultTest {
+public class FinalStaticArrayShouldNotCauseSegFaultRegressionTest {
 
   @Test
-  public void test() throws IOException, ClassNotFoundException {
-    // Iterate enough to cause JIT to compile
-    // javax.print.attribute.EnumSyntax::readResolve
+  public void finalStaticArrayShouldNotCauseSegFault() throws Exception {
+    // Iterate enough to cause JIT to compile javax.print.attribute.EnumSyntax::readResolve
     for (int i = 0; i < 100_000; i++) {
-      // Must execute two or more subclasses with static final arrays of
-      // different types.
+      // Must execute two or more subclasses with static final arrays of different types.
       doEvictionAlgorithm();
       doEvictionAction();
     }
   }
 
-  protected void doEvictionAlgorithm() throws IOException, ClassNotFoundException {
-    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
-    final ObjectOutputStream oos = new ObjectOutputStream(baos);
-    oos.writeObject(EvictionAlgorithm.NONE);
-    oos.close();
+  private void doEvictionAlgorithm() throws IOException, ClassNotFoundException {
+    ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
-    final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
-    final ObjectInputStream ois = new ObjectInputStream(bais);
-    ois.readObject();
-    ois.close();
+    try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
+      oos.writeObject(EvictionAlgorithm.NONE);
+    }
+
+    try (ObjectInputStream ois =
+        new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()))) {
+      ois.readObject();
+    }
   }
 
-  protected void doEvictionAction() throws IOException, ClassNotFoundException {
-    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
-    final ObjectOutputStream oos = new ObjectOutputStream(baos);
-    oos.writeObject(EvictionAction.NONE);
-    oos.close();
+  private void doEvictionAction() throws IOException, ClassNotFoundException {
+    ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
-    final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
-    final ObjectInputStream ois = new ObjectInputStream(bais);
-    ois.readObject();
-    ois.close();
-  }
+    try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
+      oos.writeObject(EvictionAction.NONE);
+    }
 
+    try (ObjectInputStream ois =
+        new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()))) {
+      ois.readObject();
+    }
+  }
 }

-- 
To stop receiving notification emails like this one, please contact
klund@apache.org.