You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by da...@apache.org on 2017/01/10 17:10:46 UTC
[1/5] tinkerpop git commit: added license and author
Repository: tinkerpop
Updated Branches:
refs/heads/tp32 2d824cf29 -> e3e0bef78
added license and author
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/6c8337fc
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/6c8337fc
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/6c8337fc
Branch: refs/heads/tp32
Commit: 6c8337fc273795201bd556357e8390ac9eb0cc82
Parents: df3bba5
Author: davebshow <da...@gmail.com>
Authored: Sat Dec 10 11:12:14 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Dec 16 11:52:15 2016 -0500
----------------------------------------------------------------------
.../test_driver_remote_connection_threaded.py | 23 ++++++++++++++++++++
1 file changed, 23 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6c8337fc/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py
index 759126b..e27e52c 100644
--- a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py
+++ b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py
@@ -1,3 +1,26 @@
+'''
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+'''
+
+
+__author__ = 'David M. Brown (davebshow@gmail.com)'
+
+
import sys
from threading import Thread
[3/5] tinkerpop git commit: allow user to pass loop to
DriverRemoteConnection. added multi-threaded tests.
Posted by da...@apache.org.
allow user to pass loop to DriverRemoteConnection. added multi-threaded tests.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/4649c812
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4649c812
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4649c812
Branch: refs/heads/tp32
Commit: 4649c81201889e29f011d1aa46b5b6a2fab58470
Parents: 347a0a9
Author: davebshow <da...@gmail.com>
Authored: Fri Dec 9 16:40:53 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Dec 16 11:52:15 2016 -0500
----------------------------------------------------------------------
.../driver/driver_remote_connection.py | 4 +-
.../test_driver_remote_connection_threaded.py | 69 ++++++++++++++++++++
2 files changed, 72 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4649c812/gremlin-python/src/main/jython/gremlin_python/driver/driver_remote_connection.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/driver/driver_remote_connection.py b/gremlin-python/src/main/jython/gremlin_python/driver/driver_remote_connection.py
index d975f60..37fcd1a 100644
--- a/gremlin-python/src/main/jython/gremlin_python/driver/driver_remote_connection.py
+++ b/gremlin-python/src/main/jython/gremlin_python/driver/driver_remote_connection.py
@@ -39,7 +39,9 @@ class DriverRemoteConnection(RemoteConnection):
self._url = url
self._username = username
self._password = password
- if loop is None: self._loop = ioloop.IOLoop.current()
+ if loop is None:
+ loop = ioloop.IOLoop.current()
+ self._loop = loop
self._websocket = self._loop.run_sync(lambda: websocket.websocket_connect(self.url))
self._graphson_reader = graphson_reader or GraphSONReader()
self._graphson_writer = graphson_writer or GraphSONWriter()
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4649c812/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py
new file mode 100644
index 0000000..756ef90
--- /dev/null
+++ b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py
@@ -0,0 +1,69 @@
+import sys
+from queue import Queue
+from threading import Thread
+
+import pytest
+
+from tornado import ioloop
+
+from gremlin_python.driver.driver_remote_connection import (
+ DriverRemoteConnection)
+from gremlin_python.structure.graph import Graph
+
+
+skip = False
+try:
+ connection = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g')
+ connection.close()
+except:
+ skip = True
+
+
+@pytest.mark.skipif(skip, reason='Gremlin Server is not running')
+class TestDriverRemoteConnectionThreaded:
+
+ def test_threaded_client(self):
+ q = Queue()
+ # Here if we give each thread its own loop there is no problem.
+ loop1 = ioloop.IOLoop()
+ loop2 = ioloop.IOLoop()
+ child = Thread(target=self._executor, args=(q, loop1))
+ child2 = Thread(target=self._executor, args=(q, loop2))
+ child.start()
+ child2.start()
+ for x in range(2):
+ success = q.get()
+ assert success == 'success!'
+ child.join()
+ child2.join()
+
+ def test_threaded_client_error(self):
+ q = Queue()
+ # This scenario fails because both threads try to access the main
+ # thread event loop - bad - each thread needs its own loop.
+ # This is what happens when you can't manually set the loop.
+ child = Thread(target=self._executor, args=(q, None))
+ child2 = Thread(target=self._executor, args=(q, None))
+ child.start()
+ child2.start()
+ with pytest.raises(RuntimeError):
+ try:
+ for x in range(2):
+ exc = q.get()
+ if issubclass(exc, Exception):
+ raise exc()
+ finally:
+ child.join()
+ child2.join()
+
+ def _executor(self, q, loop):
+ try:
+ connection = DriverRemoteConnection(
+ 'ws://localhost:8182/gremlin', 'g', loop=loop)
+ g = Graph().traversal().withRemote(connection)
+ assert len(g.V().toList()) == 6
+ except:
+ q.put(sys.exc_info()[0])
+ else:
+ q.put('success!')
+ connection.close()
[2/5] tinkerpop git commit: use six.moves for legacy import. fixed
testing port number
Posted by da...@apache.org.
use six.moves for legacy import. fixed testing port number
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/df3bba52
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/df3bba52
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/df3bba52
Branch: refs/heads/tp32
Commit: df3bba525b8cdd7f42aaf6508dfc575b9ad85e7a
Parents: 4649c81
Author: davebshow <da...@gmail.com>
Authored: Fri Dec 9 17:32:45 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Dec 16 11:52:15 2016 -0500
----------------------------------------------------------------------
.../driver/test_driver_remote_connection_threaded.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/df3bba52/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py
index 756ef90..759126b 100644
--- a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py
+++ b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py
@@ -1,9 +1,9 @@
import sys
-from queue import Queue
from threading import Thread
import pytest
+from six.moves import queue
from tornado import ioloop
from gremlin_python.driver.driver_remote_connection import (
@@ -13,7 +13,7 @@ from gremlin_python.structure.graph import Graph
skip = False
try:
- connection = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g')
+ connection = DriverRemoteConnection('ws://localhost:45940/gremlin', 'g')
connection.close()
except:
skip = True
@@ -23,7 +23,7 @@ except:
class TestDriverRemoteConnectionThreaded:
def test_threaded_client(self):
- q = Queue()
+ q = queue.Queue()
# Here if we give each thread its own loop there is no problem.
loop1 = ioloop.IOLoop()
loop2 = ioloop.IOLoop()
@@ -38,7 +38,7 @@ class TestDriverRemoteConnectionThreaded:
child2.join()
def test_threaded_client_error(self):
- q = Queue()
+ q = queue.Queue()
# This scenario fails because both threads try to access the main
# thread event loop - bad - each thread needs its own loop.
# This is what happens when you can't manually set the loop.
@@ -59,7 +59,7 @@ class TestDriverRemoteConnectionThreaded:
def _executor(self, q, loop):
try:
connection = DriverRemoteConnection(
- 'ws://localhost:8182/gremlin', 'g', loop=loop)
+ 'ws://localhost:45940/gremlin', 'g', loop=loop)
g = Graph().traversal().withRemote(connection)
assert len(g.V().toList()) == 6
except:
[4/5] tinkerpop git commit: removed non-deterministic threaded test
Posted by da...@apache.org.
removed non-deterministic threaded test
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/4340923b
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4340923b
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4340923b
Branch: refs/heads/tp32
Commit: 4340923ba75f05b58e798a82ef9ced1ea98e1e34
Parents: 6c8337f
Author: davebshow <da...@gmail.com>
Authored: Fri Dec 16 17:10:41 2016 -0500
Committer: davebshow <da...@gmail.com>
Committed: Fri Dec 16 17:10:41 2016 -0500
----------------------------------------------------------------------
.../test_driver_remote_connection_threaded.py | 19 -------------------
1 file changed, 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4340923b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py
index e27e52c..0c18651 100644
--- a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py
+++ b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py
@@ -60,25 +60,6 @@ class TestDriverRemoteConnectionThreaded:
child.join()
child2.join()
- def test_threaded_client_error(self):
- q = queue.Queue()
- # This scenario fails because both threads try to access the main
- # thread event loop - bad - each thread needs its own loop.
- # This is what happens when you can't manually set the loop.
- child = Thread(target=self._executor, args=(q, None))
- child2 = Thread(target=self._executor, args=(q, None))
- child.start()
- child2.start()
- with pytest.raises(RuntimeError):
- try:
- for x in range(2):
- exc = q.get()
- if issubclass(exc, Exception):
- raise exc()
- finally:
- child.join()
- child2.join()
-
def _executor(self, q, loop):
try:
connection = DriverRemoteConnection(
[5/5] tinkerpop git commit: Merge branch 'TINKERPOP-1581' into tp32
Posted by da...@apache.org.
Merge branch 'TINKERPOP-1581' into tp32
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e3e0bef7
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e3e0bef7
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e3e0bef7
Branch: refs/heads/tp32
Commit: e3e0bef787a60ba9cfd58dd5ef22c0f32025b7e6
Parents: 2d824cf 4340923
Author: davebshow <da...@gmail.com>
Authored: Tue Jan 10 12:08:33 2017 -0500
Committer: davebshow <da...@gmail.com>
Committed: Tue Jan 10 12:08:33 2017 -0500
----------------------------------------------------------------------
.../driver/driver_remote_connection.py | 4 +-
.../test_driver_remote_connection_threaded.py | 73 ++++++++++++++++++++
2 files changed, 76 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3e0bef7/gremlin-python/src/main/jython/gremlin_python/driver/driver_remote_connection.py
----------------------------------------------------------------------