Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors in the Python client tests #1619

Closed
Tryneus opened this issue Nov 7, 2013 · 5 comments
Closed

Errors in the Python client tests #1619

Tryneus opened this issue Nov 7, 2013 · 5 comments
Assignees
Milestone

Comments

@Tryneus
Copy link
Member

Tryneus commented Nov 7, 2013

Running the python client tests result in the following errors. These tests worked about a week ago, so I suspect this is a result of the new explain stuff.

======================================================================
ERROR: test_close (__main__.TestCursor)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "connections/cursor.py", line 34, in test_close
    self.cur.close()
  File "../../drivers/python/rethinkdb/net.py", line 73, in close
    self.conn._end_cursor(self)
  File "../../drivers/python/rethinkdb/net.py", line 213, in _end_cursor
    return self._send_query(cursor.query, cursor.term)
  File "../../drivers/python/rethinkdb/net.py", line 298, in _send_query
    raise RqlClientError(message, term, frames)
RqlClientError: RqlClientError: MALFORMED PROTOBUF (spurious field `query`):
type: CONTINUE
query {
  [ql2.extension.backtrace] {
    frames {
      type: POS
      pos: -2
    }
  }
}
token: 1
 in:
r.table('test')
^^^^^^^^^^^^^^^
======================================================================
ERROR: test_count (__main__.TestCursor)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "connections/cursor.py", line 27, in test_count
    for row in self.cur:
  File "../../drivers/python/rethinkdb/net.py", line 61, in __iter__
    self.conn._continue_cursor(self)
  File "../../drivers/python/rethinkdb/net.py", line 192, in _continue_cursor
    self._update_cursor(self._read_response(cursor.query.token))
  File "../../drivers/python/rethinkdb/net.py", line 217, in _update_cursor
    raise RqlDriverError("Unexpected response type received for cursor token")
RqlDriverError: Unexpected response type received for cursor token

----------------------------------------------------------------------
Ran 3 tests in 23.049s

There are a bunch of these, but it seems misleading because the client error is unprintable.

======================================================================
ERROR: test_connect_correct_auth (__main__.TestAuthConnection)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "connections/connection.py", line 168, in test_connect_correct_auth
    conn.reconnect()
  File "../../drivers/python/rethinkdb/net.py", line 104, in reconnect
    self.close(noreply_wait)
  File "../../drivers/python/rethinkdb/net.py", line 134, in close
    self.noreply_wait()
  File "../../drivers/python/rethinkdb/net.py", line 153, in noreply_wait
    return self._send_query(query, 'noreply_wait')
  File "../../drivers/python/rethinkdb/net.py", line 298, in _send_query
    raise RqlClientError(message, term, frames)
RqlClientError: <unprintable RqlClientError object>
@ghost ghost assigned Tryneus Nov 7, 2013
@coffeemug
Copy link
Contributor

Hmm, it seems like you'd just have to rebuild the driver to make sure the client tests use the right one, no?

@Tryneus
Copy link
Member Author

Tryneus commented Nov 7, 2013

I've remade the drivers, though it's possible I'm doing it wrong. I'll try with a fresh repo.

@Tryneus
Copy link
Member Author

Tryneus commented Nov 7, 2013

Same result on a fresh repo.

@Tryneus
Copy link
Member Author

Tryneus commented Nov 8, 2013

There were a number of problems I found:

  1. The server annotates queries with backtraces, but this had been moved to before the query protobuf was validated (through various means of code indirection and blame-shifting). As it so happened, this it fine in the general case, but as soon as you have CONTINUE queries (or any non-START query), the server assumes the client fucked up the protobuf and errors. Really, the server should only annotate START queries, so I juggled around where this is done, and that part works fine now.
  2. The python client was not handling errors on CONTINUE queries correctly. This was my fault from the python cursor prebuffering issue, but now when an error occurs on CONTINUE, the response gets properly saved and should be returned to the user when they get to it in their cursor.
  3. A copy-paste error in the javascript driver broke streams that fit inside a single message.

The fixes for these are up in code review 1015.

@Tryneus
Copy link
Member Author

Tryneus commented Nov 8, 2013

Ok, this has been approved and merged into next in commits 3a379df, a787563, ddb3653, and bf81167. Will be in release 1.11.

@Tryneus Tryneus closed this as completed Nov 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants