You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Stephen Mallette (Jira)" <ji...@apache.org> on 2021/03/25 11:47:00 UTC

[jira] [Closed] (TINKERPOP-2538) traversal is not always closed in Tinkerpop test suites

     [ https://issues.apache.org/jira/browse/TINKERPOP-2538?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephen Mallette closed TINKERPOP-2538.
---------------------------------------
    Resolution: Won't Do

I think that most graphs that hold resources in a Traversal tend to handle this sort of thing internally. TinkerGraph does it by peeking at the next item in the {{Iterator}} to see if anything is left and then closing. That works for TinkerGraph as it is in-memory and that costs is small - this approach probably wouldn't work elsewhere. Perhaps we should have designed the test suite in a way to better call {{close()}} but I think that is a bigger and separate issue that we likely don't want to start for TP3 if at all possible. I will close this for now, but if we later determine this must be a feature of TinkerPop or the test suite more specifically then we can have that discussion.

> traversal is not always closed in Tinkerpop test suites
> -------------------------------------------------------
>
>                 Key: TINKERPOP-2538
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2538
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: test-suite
>    Affects Versions: 3.4.10
>            Reporter: Norio Akagi
>            Priority: Minor
>
> Tinkerpop offers test suites so that GraphProviders can utilize and test their own Graph database implementation.
> [http://tinkerpop.apache.org/docs/3.4.10-SNAPSHOT/dev/provider/#validating-with-gremlin-test]
> The concept is that a graph provider can pass GraphProvider and Graph class to inject their own implementation. GraphProvider needs to implement *clear* method to clean up resources after each test case is complete.
> However, depending on the design GraphProvider's implementation requires GraphTraversal to be closed after a query is complete. Right now there is no way for Graph instance to clean up running traversals.
> This leads to the issue that in unit test case some resource won't be released.
> One example can be seen here:
> [https://github.com/apache/tinkerpop/blob/0d266da3e5c274afa9306367263e5c9098bedd93/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoCustomTest.java#L151]
> In the code above, we run one traversal to get a Vertex but the traversal `g1.traversal()` is not closed.
> Ideally Tinkerpop should take this use-case into account and clean up traversals in test-suites (or at least provide a way to do that for providers without touching the test-suite code base).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)