-
Notifications
You must be signed in to change notification settings - Fork 913
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
Conversation
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 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", |
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 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.
@@ -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": |
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.
We were missing this test runner operation. It's needed in some newly updated transactions/legacy
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.
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() |
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.
Nit: should this also assert clientSession
is not nil
?
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.
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.
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.
Per offline discussion, SDAM integration tests will be updated as part of follow-up work. LGTM!
GODRIVER-2002
Updates a number of spec tests that contain variations of
slaveok
to use variations ofsecondaryok
. RemovesSlaveOk
from source code and replaces it withSecondaryOk
.The Go driver did not parse a
slaveOK
connection string option, so there was no work there.