Skip to content

Test suite compatibility with server 4.0.0-rc5 #851

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 1 commit into from
Jun 15, 2018

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Jun 15, 2018

Various fixes for test failures encountered whilst running against 4.0.0-rc5 in both standalone and replica set modes.

Note: I punted on updating tests that still relied on replica set configurations used by the MO Vagrant enivironment. This includes expectations for particular hosts, ports, number of replica set members, and replica set tags.

@jmikola jmikola requested a review from derickr June 15, 2018 18:53
@@ -48,7 +48,7 @@ try {
--EXPECTF--
started: findAndModify
failed: findAndModify
object(stdClass)#%d (%d) {
object(stdClass)#%d (%d) {%A
Copy link
Member Author

Choose a reason for hiding this comment

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

4.0.0-rc5 replica set reports "operationTime" as the first field in the command response.

@@ -92,7 +92,7 @@ object(MongoDB\Driver\Monitoring\CommandFailedEvent)#%d (%d) {
["operationId"]=>
string(%d) "%s"
["reply"]=>
object(stdClass)#%d (%d) {
object(stdClass)#%d (%d) {%A
Copy link
Member Author

Choose a reason for hiding this comment

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

Also for "operationTime" reported by 4.0.0-rc5 replica set.

@@ -116,7 +116,7 @@ object(MongoDB\Driver\BulkWrite)#%d (%d) {
["executed"]=>
bool(true)
["server_id"]=>
int(1)
int(%r[1-9]\d*%r)
Copy link
Member Author

Choose a reason for hiding this comment

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

Not specifically for 4.0.0-rc5, but when the second node in my replica set was the primary this reported 2 instead of 1. We really just want to assert that it's non-zero.

@@ -67,5 +67,5 @@ object(stdClass)#%d (%d) {
Waited for 0.%d seconds
Awaiting results...
NULL
Waited for 0.5%d seconds
Waited for 0.%r(4|5)\d*%r seconds
Copy link
Member Author

Choose a reason for hiding this comment

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

MongoDB 3.6 and earlier would typically wait just under 500ms, while 4.0.0-rc5 appeared to wait a bit over. This regex will test that we're waiting somewhere in the range of 400-599 milliseconds, which I think is reasonable to ensure our maxTimeMS is respected.

}

?>
===DONE===
<?php exit(0); ?>
--EXPECTF--
--EXPECT--
Copy link
Member Author

Choose a reason for hiding this comment

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

In addition to "operationTime" appearing at the top of the reply document on 4.0.0-rc5, the order of "ok" and "writeConcernError" have also been switched. Testing for that shuffle would require a very ugly regex.

This test is only asserting that an error is thrown, so I think we're better off ignoring the result document and simply checking the exception with an EXPECT.

Copy link
Contributor

@derickr derickr left a comment

Choose a reason for hiding this comment

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

lgtm

@jmikola jmikola merged commit 476c7f9 into mongodb:master Jun 15, 2018
jmikola added a commit that referenced this pull request Jun 15, 2018
@jmikola jmikola deleted the test-compat-4.0 branch June 15, 2018 23:08
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