-
Notifications
You must be signed in to change notification settings - Fork 209
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
Conversation
@@ -48,7 +48,7 @@ try { | |||
--EXPECTF-- | |||
started: findAndModify | |||
failed: findAndModify | |||
object(stdClass)#%d (%d) { | |||
object(stdClass)#%d (%d) {%A |
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.
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 |
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.
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) |
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.
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 |
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.
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-- |
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.
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
.
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.
lgtm
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.