Skip to content

GODRIVER-2002 Remove 'slaveok' from source code and most spec tests #713

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

Merged
merged 4 commits into from
Aug 5, 2021
Merged

GODRIVER-2002 Remove 'slaveok' from source code and most spec tests #713

merged 4 commits into from
Aug 5, 2021

Conversation

benjirewis
Copy link
Contributor

GODRIVER-2002

Updates a number of spec tests that contain variations of slaveok to use variations of secondaryok. Removes SlaveOk from source code and replaces it with SecondaryOk.

The Go driver did not parse a slaveOK connection string option, so there was no work there.

Copy link
Contributor Author

@benjirewis benjirewis left a comment

Choose a reason for hiding this comment

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

I don't believe any of the source code changes are API-breaking since this is all under x.

@@ -24,6 +24,7 @@ var (
"collection-management",
"command-monitoring/unified",
"sessions/unified",
"retryable-writes/unified",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I synced the retryable-writes spec tests. This is unrelated to oppressive language removal, but it's always good to update tests as long as they pass. Some retryable writes tests had been ported over to the unified test format, so I added them to the test runner.

@benjirewis benjirewis requested a review from kevinAlbs August 4, 2021 16:34
@benjirewis benjirewis marked this pull request as ready for review August 4, 2021 16:34
@@ -437,6 +437,19 @@ func executeTestRunnerOperation(mt *mtest.T, testCase *testCase, op *operation,
fp, err := op.Arguments.LookupErr("failPoint")
assert.Nil(mt, err, "failPoint not found in arguments")
mt.SetFailPointFromDocument(fp.Document())
case "assertSessionTransactionState":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We were missing this test runner operation. It's needed in some newly updated transactions/legacy tests.

Copy link
Contributor

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

Changes look good.

I checked with a grep command modified from this comment.

ggrep -PriI 'slave' --exclude-dir=vendor --exclude-dir=.git .

That shows "slave" in the title or contents of SDAM integration tests. Comparing with the specifications repo I think those have been updated. Should those be updated in this PR?

assert.Nil(mt, err, "state not found in arguments")
expectedState, ok := stateVal.StringValueOK()
assert.True(mt, ok, "state argument is not a string")
actualState := clientSession.TransactionState.String()
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: should this also assert clientSession is not nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good idea. I think the only time clientSession would be nil is if there was a malformed test with an assertSessionTransactionState and no corresponding session argument, but it's still worth having a check. There are numerous assertions on the fields of clientSession in this function without preceding NotNil assertions on clientSession, so I filed GODRIVER-2117.

Copy link
Contributor

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

Per offline discussion, SDAM integration tests will be updated as part of follow-up work. LGTM!

@benjirewis benjirewis merged commit 83fefd1 into mongodb:master Aug 5, 2021
@benjirewis benjirewis deleted the slaveOK.2002 branch August 5, 2021 16:25
faem pushed a commit to kubedb/mongo-go-driver that referenced this pull request Mar 17, 2022
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