KangweiZhu opened a new pull request, #3237:
URL: https://github.com/apache/tinkerpop/pull/3237

   We observed several tests in GraphSONTypedCompatibilityTest  that exhibited 
flaky behavior when executed with NonDex. Specifically speaking, we can 
reproduce them by using the following commands.
   ```
   mvn clean install -DskipTests -Drat.skip=true
   ```
   * Test shouldReadWriteEdge[expect(v2)]
   ```bash
   mvn clean -pl gremlin-util edu.illinois:nondex-maven-plugin:2.2.1:nondex 
-Dtest="org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTypedCompatibilityTest#shouldReadWriteEdge[expect(v2)]"
 -Drat.skip=true
   ```
   
   * Test shouldReadWriteEdge[expect(v3)]
   ```bash
   mvn clean -pl gremlin-util edu.illinois:nondex-maven-plugin:2.2.1:nondex 
-Dtest="org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTypedCompatibilityTest#shouldReadWriteEdge[expect(v3)]"
 -Drat.skip=true
   ```
   
   * Test shouldReadWritePath[expect(v2)]
   ```bash
   mvn clean -pl gremlin-util edu.illinois:nondex-maven-plugin:2.2.1:nondex 
-Dtest="org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTypedCompatibilityTest#shouldReadWritePath[expect(v2)]"
 -Drat.skip=true
   ```
   
   * Test shouldReadWritePath[expect(v3)]
   ```bash
   mvn clean -pl gremlin-util edu.illinois:nondex-maven-plugin:2.2.1:nondex 
-Dtest="org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTypedCompatibilityTest#shouldReadWritePath[expect(v3)]"
 -Drat.skip=true
   ```
   
   * Test shouldReadWriteProperty[expect(v2)]
   ```bash
   mvn clean -pl gremlin-util edu.illinois:nondex-maven-plugin:2.2.1:nondex 
-Dtest="org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTypedCompatibilityTest#shouldReadWriteProperty[expect(v2)]"
 -Drat.skip=true
   ```
   
   * Test shouldReadWriteProperty[expect(v3)]
   ```bash
   mvn clean -pl gremlin-util edu.illinois:nondex-maven-plugin:2.2.1:nondex 
-Dtest="org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTypedCompatibilityTest#shouldReadWriteProperty[expect(v3)]"
 -Drat.skip=true
   ```
   
   * Test shouldReadWriteTraverser[expect(v2)]
   ```bash
   mvn clean -pl gremlin-util edu.illinois:nondex-maven-plugin:2.2.1:nondex 
-Dtest="org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTypedCompatibilityTest#shouldReadWriteTraverser[expect(v2)]"
 -Drat.skip=true
   ```
   
   * Test shouldReadWriteTraverser[expect(v3)]
   ```bash
   mvn clean -pl gremlin-util edu.illinois:nondex-maven-plugin:2.2.1:nondex 
-Dtest="org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTypedCompatibilityTest#shouldReadWriteTraverser[expect(v3)]"
 -Drat.skip=true
   ```
   
   * Test shouldReadWriteVertexProperty[expect(v2)]
   ```bash
   mvn clean -pl gremlin-util edu.illinois:nondex-maven-plugin:2.2.1:nondex 
-Dtest="org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTypedCompatibilityTest#shouldReadWriteVertexProperty[expect(v2)]"
 -Drat.skip=true
   ```
   
   * Test shouldReadWriteVertexProperty[expect(v3)]
   ```bash
   mvn clean -pl gremlin-util edu.illinois:nondex-maven-plugin:2.2.1:nondex 
-Dtest="org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTypedCompatibilityTest#shouldReadWriteVertexProperty[expect(v3)]"
 -Drat.skip=true
   ```
   
   * Test shouldReadWriteVertex[expect(v2)]
   ```bash
   mvn clean -pl gremlin-util edu.illinois:nondex-maven-plugin:2.2.1:nondex 
-Dtest="org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTypedCompatibilityTest#shouldReadWriteVertex[expect(v2)]"
 -Drat.skip=true
   ```
   
   * Test shouldReadWriteVertex[expect(v3)]
   ```bash
   mvn clean -pl gremlin-util edu.illinois:nondex-maven-plugin:2.2.1:nondex 
-Dtest="org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTypedCompatibilityTest#shouldReadWriteVertex[expect(v3)]"
 -Drat.skip=true
   ```
   And the error should be something like this:
   ```
   [ERROR] Failures:
   [ERROR]   
GraphSONTypedCompatibilityTest>AbstractTypedCompatibilityTest.shouldReadWriteEdge:322
 expected:<e[17][7-develops->10]> but was:<e[13][1-develops->10]>
   [ERROR]   
GraphSONTypedCompatibilityTest>AbstractTypedCompatibilityTest.shouldReadWriteEdge:322
 expected:<e[17][7-develops->10]> but was:<e[13][1-develops->10]>
   ```
   
   Upon our investigation, the root cause is the use of:
   ```
   protected Map<Object, Vertex> vertices = new ConcurrentHashMap<>();
   protected Map<Object, Edge> edges = new ConcurrentHashMap<>();
   ```
   in TinkerGraph.java, which does not guarantee a deterministic order.
   
   The simplest fix would be to replace ConcurrentHashMap with LinkedHashMap, 
as we did in a previous PR. We've confirmed that this change could remove the 
flakiness of these tests. However, we are concerned that such a change might 
introduce unintended side effects in the code under test. Another possible fix 
would be to deterministically select a fixed id, but that approach would make 
the test become sensitive to future implementation changes. Thus, we decided to 
use this sorting-based approach to deflake this test.
   
   <!--
   Thanks for contributing! Reminders:
   + TARGET the earliest branch where you want the change
       3.7-dev -> 3.7.5 (non-breaking only)
       3.8-dev -> 3.8.0
       master  -> 4.0.0
   + Committers will MERGE the PR forward to newer versions
   + ADD entry to the CHANGELOG.asciidoc for the targeted version
       Do not reference a JIRA number there
   + ADD JIRA number to title and link in description
   + PRs requires 3 +1s from committers OR
                  1 +1 and 7 day wait to merge.
   + MORE details: https://s.apache.org/rtnal
   -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to