-
Notifications
You must be signed in to change notification settings - Fork 1.8k
test(NODE-5929): convert txn legacy spec tests #3987
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
Conversation
dfeb836
to
126abd9
Compare
@@ -735,7 +735,9 @@ export function expectErrorCheck( | |||
} | |||
|
|||
if (expected.errorContains != null) { | |||
expect(error.message, expectMessage).to.include(expected.errorContains); | |||
expect(error.message.toLowerCase(), expectMessage.toLowerCase()).to.include( | |||
expected.errorContains.toLowerCase() |
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.
Unified test runner spec states this check should be case insensitive, so I just fixed it here as a few tests were failing because of it.
@@ -497,7 +497,7 @@ operations.set('replaceOne', async ({ entities, operation }) => { | |||
|
|||
operations.set('startTransaction', async ({ entities, operation }) => { | |||
const session = entities.getEntity('session', operation.object); | |||
session.startTransaction(); | |||
session.startTransaction(operation.arguments); |
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.
One issue this update exposed was the args weren't getting passed to 'startTransaction`. I've also updated the test changes in this PR to address my comments in mongodb/specifications#1502
@@ -0,0 +1,29 @@ | |||
import * as path from 'path'; |
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.
'transaction options inherited from defaultTransactionOptions', | ||
'transaction options inherited from client', | ||
'causal consistency disabled' | ||
// TODO(NODE-5855) - Gone away after NODE-5929 |
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.
The unified tests that are related to NODE-5855 are automatically skipped by the unified tests due to the fact that targetedFailPoint
will not work with multiple mongoses in load balancer mode. So those tests only run on sharded clusters.
fdf7d5b
to
97d13df
Compare
Remaining random failures related to https://jira.mongodb.org/browse/DRIVERS-2816. Underneath the hood the extra command started events are from the txn aborting due to a migration conflict and then retrying. Note that I did not skip these as the failure happens on random tests, and did not want to skip all of them to cover it, but can to keep everything green. |
e871882
to
f8d463a
Compare
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.
quick nit, and let's figure out what to do with the too often flaky tests 🤔
// In case the endSession logic didn't unpin the server. | ||
// session.unpin({ force: true }); |
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.
Shall we just delete this?
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.
Removed.
|
||
runUnifiedSuite(loadSpecTests(path.join('transactions-convenient-api', 'unified')), test => { | ||
return SKIPPED_TESTS.includes(test.description) | ||
? 'TODO(NODE-): Skipping failing transaction tests' |
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.
Is this for the tests failing related to https://jira.mongodb.org/browse/DRIVERS-2816? Maybe we can skip or retry based on the outcome of the test? I know neither is easy given the structure of the unified runner... The Mocha context is passed to the runner and would be the same context given to an afterEach hook, maybe there's a way to communicate "unfailing" the test that way?
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.
I took the path of least resistance and just skipped individually for now.
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.
@nbbeeken Hold off for review again I still see I have a few more to skip individually.
30e0843
to
032c3fc
Compare
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.
putting in req changes so you can send it back to me when ready
Description
Node verification of mongodb/specifications#1502 and mongodb/specifications#1505
What is changing?
Syncs all the transaction unified tests, removes the legacy tests, fixes read preference issues and error message comparison issues in the unified runner.
Is there new documentation needed for these changes?
None
What is the motivation for this change?
NODE-3299/DRIVERS-1709
Double check the following
npm run check:lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript