You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Dan LaRocque (JIRA)" <ji...@apache.org> on 2016/08/02 11:53:20 UTC

[jira] [Created] (TINKERPOP-1393) RepeatUnrollStrategy alters traversal behavior

Dan LaRocque created TINKERPOP-1393:
---------------------------------------

             Summary: RepeatUnrollStrategy alters traversal behavior
                 Key: TINKERPOP-1393
                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1393
             Project: TinkerPop
          Issue Type: Bug
    Affects Versions: 3.2.1
            Reporter: Dan LaRocque


I think https://github.com/apache/tinkerpop/commit/6208b90b2ca297186b4f75f356e0093d4b6ed280 may contain a bug.

Consider this normal-looking gremlin-console session from the immediately preceding commit (not 6208b but the commit right before):

{noformat}
tinkerpop$ git checkout 6208b90b2ca297186b4f75f356e0093d4b6ed280~
tinkerpop$ mvn clean install -DskipTests=true
tinkerpop$ gremlin-console/bin/gremlin.sh 

         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> tg = TinkerGraph.open()
==>tinkergraph[vertices:0 edges:0]
gremlin> ego = tg.addVertex('vertex')
==>v[0]
gremlin> p1 = tg.addVertex('vertex')
==>v[1]
gremlin> p2 = tg.addVertex('vertex')
==>v[2]
gremlin> p3 = tg.addVertex('vertex')
==>v[3]
gremlin> ego.addEdge('knows', p1)
==>e[4][0-knows->1]
gremlin> ego.addEdge('knows', p2)
==>e[5][0-knows->2]
gremlin> ego.addEdge('knows', p3)
==>e[6][0-knows->3]
gremlin> tg.traversal().V().repeat(both()).times(3).tail(7)
==>v[0]
==>v[0]
==>v[0]
==>v[0]
==>v[0]
==>v[0]
==>v[0]
gremlin> tg.traversal().V().both().both().both().count()
==>18
gremlin> tg.traversal().V().repeat(both()).times(3).tail(7).count()
==>7
gremlin>
{noformat}

So far so good.

However, 6208b changes the last traversal result from 7 to 6:

{noformat}
tinkerpop$ git checkout 6208b90b2ca297186b4f75f356e0093d4b6ed280
tinkerpop$ mvn clean install -DskipTests=true
tinkerpop$ gremlin-console/bin/gremlin.sh     

         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> tg = TinkerGraph.open()
==>tinkergraph[vertices:0 edges:0]
gremlin> ego = tg.addVertex('vertex')
==>v[0]
gremlin> p1 = tg.addVertex('vertex')
==>v[1]
gremlin> p2 = tg.addVertex('vertex')
==>v[2]
gremlin> p3 = tg.addVertex('vertex')
==>v[3]
gremlin> ego.addEdge('knows', p1)
==>e[4][0-knows->1]
gremlin> ego.addEdge('knows', p2)
==>e[5][0-knows->2]
gremlin> ego.addEdge('knows', p3)
==>e[6][0-knows->3]
gremlin> tg.traversal().V().repeat(both()).times(3).tail(7)
==>v[0]
==>v[0]
==>v[0]
==>v[0]
==>v[0]
==>v[0]
gremlin> tg.traversal().V().both().both().both().count()
==>18
gremlin> tg.traversal().V().repeat(both()).times(3).tail(7).count()
==>6
{noformat}

Confusingly, {{mvn -pl tinkergraph-gremlin -Dtest=TinkerGraphProcessStandardTest clean verify}} passes.  That test includes {{TailTest$Traversals.g_V_repeatXbothX_timesX3X_tailX7X}}, which seems like it would catch this kind of bug, but said test succeeds.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)