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

PYTHON-2806 Fix test_aggregate_raw_transaction #673

Merged
merged 1 commit into from Jul 12, 2021

Conversation

ShaneHarvey
Copy link
Member

No description provided.

@@ -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)
Copy link
Member Author

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'])
Copy link
Member Author

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.

Copy link
Contributor

@prashantmital prashantmital left a 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?

@ShaneHarvey ShaneHarvey merged commit da49bd8 into mongodb:master Jul 12, 2021
ShaneHarvey added a commit that referenced this pull request Jul 12, 2021
@ShaneHarvey
Copy link
Member Author

Not sure how this wasn't caught when the test was initially merged?

I'm not sure. Perhaps it was just missed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants