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
PYTHON-2806 Fix test_aggregate_raw_transaction #673
Conversation
@@ -1483,10 +1483,13 @@ def test_find_raw_transaction(self): | |||
session=session).sort('_id')) | |||
cmd = listener.results['started'][0] | |||
self.assertEqual(cmd.command_name, 'find') | |||
self.assertEqual(cmd.command['$clusterTime'], | |||
decode_all(session.cluster_time.raw)[0]) | |||
self.assertIn('$clusterTime', cmd.command) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we only care that $clusterTime was added to the outgoing command.
# Ensure we update $clusterTime from the command response. | ||
last_cmd = listener.results['succeeded'][-1] | ||
self.assertEqual(last_cmd.reply['$clusterTime']['clusterTime'], | ||
session.cluster_time['clusterTime']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we check that the most recent command response using the session is equal to the session's $clusterTime. I used ['clusterTime']
to workaround the RawBSONDocument issue; ['clusterTime']
will always be a bson Timestamp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how this wasn't caught when the test was initially merged?
(cherry picked from commit da49bd8)
I'm not sure. Perhaps it was just missed? |
No description provided.