kenhuuu commented on code in PR #3705:
URL: https://github.com/apache/tinkerpop/pull/3705#discussion_r4267035904


##########
tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerTransactionGraphTest.java:
##########
@@ -1868,6 +1869,32 @@ private void verifyCommittedSingleEdge(final 
TinkerTransactionGraph g, final Obj
         }
     }
 
+    @Test
+    public void shouldFindIndexedVertexAfterAddingEdgeToItInSameTransaction() {
+        final TinkerTransactionGraph g = TinkerTransactionGraph.open();
+        g.createIndex(PROPERTY_NAME, Vertex.class);
+        final GraphTraversalSource gtx = g.tx().begin();
+        gtx.addV().property(PROPERTY_NAME, "hub").iterate();
+        gtx.tx().commit();
+
+        gtx.addV().addE(EDGE_LABEL).to(__.V().has(PROPERTY_NAME, 
"hub")).iterate();
+
+        assertEquals(1, (long) gtx.V().has(PROPERTY_NAME, 
"hub").count().next());
+    }
+
+    @Test
+    public void shouldRollbackWithVertexIndexAndNoEdgeIndex() {

Review Comment:
   Please consider adding a regression test for rollback with an edge index but 
no vertex index. Before this fix, the incorrect vertexIndex guard also skipped 
`edgeIndex.rollback()` in that configuration, leaving the thread-local 
edge-index entries available to later transactions on the same thread. The test 
should add an indexed edge, roll back, then verify a subsequent indexed lookup 
does not return it



-- 
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