Skip to content

Conversation

@takluyver
Copy link

As discussed in #133.

This still passes the tests with Python 2, but I can't work out how to test with Python 3 - running ant -Dpython=python3 test hangs at this point:

test_tether_word_count.py
Modules: 'test_datafile','test_datafile','test_io','test_ipc','test_protocol','test_schema','test_script','test_tether_task','test_tether_task_runner','test_tether_word_count'
Non-null modules arg. creating script
pythonpath: /home/takluyver/Code/avro/lang/py/build/src:/home/takluyver/Code/avro/lang/py/build/test:/home/takluyver/Code/avro/lang/py/build/lib

@manu-chroma
Copy link

Hey @takluyver, I checked out your branch and copied tests/ directory from py3 folder to py2/src/avro/ and invoked python run_tests.py inside the tests/ directory. All tests are passing. I'm not sure if there are other Python 3 tests which are invoked by ant

(venv3) [venv3] ~/github/avro/lang/py/src/avro/tests $ python run_tests.py                                                                                                                                                            23:23:11
...............................2017-07-04 23:23:15,261 INFO test_ipc.py:118 : Echo RPC Server listening on 127.0.0.1:46881
2017-07-04 23:23:15,261 INFO test_ipc.py:119 : RPC socket: <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 46881)>
2017-07-04 23:23:15,261 INFO ipc.py:179 : Sending handshake request: {'serverHash': b'\xce\x8a<\x94i\x95\xabb*\x81\xf3\xa4t\x99;\x85', 'clientHash': b'\xce\x8a<\x94i\x95\xabb*\x81\xf3\xa4t\x99;\x85'}
2017-07-04 23:23:15,262 INFO ipc.py:204 : writing request: {'ping': {'timestamp': 31415, 'text': 'hello ping'}}
2017-07-04 23:23:15,262 INFO ipc.py:654 : Serialized request: b'\xce\x8a<\x94i\x95\xabb*\x81\xf3\xa4t\x99;\x85\x00\xce\x8a<\x94i\x95\xabb*\x81\xf3\xa4t\x99;\x85\x00\x00\x08ping\xee\xea\x03\x14hello ping'
2017-07-04 23:23:15,263 INFO ipc.py:412 : Processing handshake request: {'meta': None, 'clientProtocol': None, 'serverHash': b'\xce\x8a<\x94i\x95\xabb*\x81\xf3\xa4t\x99;\x85', 'clientHash': b'\xce\x8a<\x94i\x95\xabb*\x81\xf3\xa4t\x99;\x85'}
2017-07-04 23:23:15,263 INFO ipc.py:441 : Handshake response: {'match': 'BOTH'}
2017-07-04 23:23:15,263 INFO ipc.py:375 : Processing request: {'ping': {'timestamp': 31415, 'text': 'hello ping'}}
2017-07-04 23:23:15,263 INFO test_ipc.py:90 : Message: {"request": [{"type": {"type": "record", "namespace": "org.apache.avro.ipc.echo", "name": "Ping", "fields": [{"type": "long", "name": "timestamp", "default": -1}, {"type": "string", "name": "text", "default": ""}]}, "name": "ping"}], "errors": [], "response": {"type": "record", "namespace": "org.apache.avro.ipc.echo", "name": "Pong", "fields": [{"type": "long", "name": "timestamp", "default": -1}, {"type": "org.apache.avro.ipc.echo.Ping", "name": "ping"}]}}
2017-07-04 23:23:15,263 INFO test_ipc.py:91 : Request: {'ping': {'timestamp': 31415, 'text': 'hello ping'}}
2017-07-04 23:23:15,264 INFO ipc.py:656 : Serialized response: b'\x00\x00\x00\x00\x00\x00\x80\xf0\xe0\xeb\xa1W\xee\xea\x03\x14hello ping'
127.0.0.1 - - [04/Jul/2017 23:23:15] "POST / HTTP/1.1" 200 -
2017-07-04 23:23:15,264 INFO ipc.py:665 : Response sent
2017-07-04 23:23:15,264 INFO ipc.py:219 : Processing handshake response: {'serverHash': None, 'match': 'BOTH', 'serverProtocol': None, 'meta': None}
2017-07-04 23:23:15,265 INFO test_ipc.py:143 : Received echo response: {'ping': {'timestamp': 31415, 'text': 'hello ping'}, 'timestamp': 1499190795264}
2017-07-04 23:23:15,265 INFO ipc.py:179 : Sending handshake request: {'serverHash': b'\xce\x8a<\x94i\x95\xabb*\x81\xf3\xa4t\x99;\x85', 'clientHash': b'\xce\x8a<\x94i\x95\xabb*\x81\xf3\xa4t\x99;\x85'}
2017-07-04 23:23:15,265 INFO ipc.py:204 : writing request: {'ping': {'timestamp': 123456, 'text': 'hello again'}}
2017-07-04 23:23:15,266 INFO ipc.py:654 : Serialized request: b'\xce\x8a<\x94i\x95\xabb*\x81\xf3\xa4t\x99;\x85\x00\xce\x8a<\x94i\x95\xabb*\x81\xf3\xa4t\x99;\x85\x00\x00\x08ping\x80\x89\x0f\x16hello again'
2017-07-04 23:23:15,266 INFO ipc.py:412 : Processing handshake request: {'meta': None, 'clientProtocol': None, 'serverHash': b'\xce\x8a<\x94i\x95\xabb*\x81\xf3\xa4t\x99;\x85', 'clientHash': b'\xce\x8a<\x94i\x95\xabb*\x81\xf3\xa4t\x99;\x85'}
2017-07-04 23:23:15,266 INFO ipc.py:441 : Handshake response: {'match': 'BOTH'}
2017-07-04 23:23:15,266 INFO ipc.py:375 : Processing request: {'ping': {'timestamp': 123456, 'text': 'hello again'}}
2017-07-04 23:23:15,266 INFO test_ipc.py:90 : Message: {"request": [{"type": {"type": "record", "namespace": "org.apache.avro.ipc.echo", "name": "Ping", "fields": [{"type": "long", "name": "timestamp", "default": -1}, {"type": "string", "name": "text", "default": ""}]}, "name": "ping"}], "errors": [], "response": {"type": "record", "namespace": "org.apache.avro.ipc.echo", "name": "Pong", "fields": [{"type": "long", "name": "timestamp", "default": -1}, {"type": "org.apache.avro.ipc.echo.Ping", "name": "ping"}]}}
2017-07-04 23:23:15,266 INFO test_ipc.py:91 : Request: {'ping': {'timestamp': 123456, 'text': 'hello again'}}
2017-07-04 23:23:15,267 INFO ipc.py:656 : Serialized response: b'\x00\x00\x00\x00\x00\x00\x84\xf0\xe0\xeb\xa1W\x80\x89\x0f\x16hello again'
127.0.0.1 - - [04/Jul/2017 23:23:15] "POST / HTTP/1.1" 200 -
2017-07-04 23:23:15,267 INFO ipc.py:665 : Response sent
2017-07-04 23:23:15,267 INFO ipc.py:219 : Processing handshake response: {'serverHash': None, 'match': 'BOTH', 'serverProtocol': None, 'meta': None}
2017-07-04 23:23:15,267 INFO test_ipc.py:149 : Received echo response: {'ping': {'timestamp': 123456, 'text': 'hello again'}, 'timestamp': 1499190795266}
...................
----------------------------------------------------------------------
Ran 50 tests in 2.114s

OK

@takluyver
Copy link
Author

There's a lang/py/test directory containing tests - they seem to be invoked by running ant test, and they work for Python 2, but get stuck when I try with Py3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants