Skip to content

Conversation

@rozza
Copy link
Member

@rozza rozza commented Mar 21, 2024

DRIVERS-2871

Please complete the following before merging:

  • Update changelog.
  • Make sure there are generated JSON files from the YAML test files.
  • Test changes in at least one language driver.
  • Test these changes against all server versions and topologies (including standalone, replica set, sharded
    clusters, and serverless).

@rozza rozza requested a review from a team as a code owner March 21, 2024 17:26
command:
insert: *collectionName
maxTimeMS: { $$type: ["int", "long"] }
- commandStartedEvent:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As withTransaction expects an error, then an abortTransaction event will be issued.

@ShaneHarvey ShaneHarvey changed the title CSOT tests: Expect withTransaction to propagate errors DRIVERS-2876 CSOT tests: Expect withTransaction to propagate errors Mar 26, 2024
@ShaneHarvey ShaneHarvey changed the title DRIVERS-2876 CSOT tests: Expect withTransaction to propagate errors DRIVERS-2871 CSOT tests: Expect withTransaction to propagate errors Mar 26, 2024
expectError:
isClientError: true
expectError:
isClientError: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In PyMongo (and Go) the "expectError" on the insertOne above causes the test runner to catch, validate, and the ignore the exception so it never reaches the withTransaction block. So this new test would fail. Is it a bug that Java propagates the exception?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see. This was recently changed in https://jira.mongodb.org/browse/DRIVERS-1709 but wasn't documented in the UTR spec itself. The only reference is in the jira ticket:

Ensure that neither ignoreResultAndError nor expectError interfere with propagating exceptions from a callback operation to withTransaction. This came up with the Java driver's POC.

Copy link
Member

@ShaneHarvey ShaneHarvey Mar 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify was this change correct?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this change is correct given the new rules for handling errors in the UTR.

@rozza rozza merged commit ebac90d into mongodb:master May 2, 2024
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

Successfully merging this pull request may close these issues.

2 participants