-
Notifications
You must be signed in to change notification settings - Fork 266
Regression tests for find() and aggregate() using primary RP within transaction #564
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
0172c9f
to
8dcc578
Compare
@@ -104,6 +106,40 @@ public function testGetNamespace() | |||
$this->assertEquals($this->getNamespace(), $this->collection->getNamespace()); | |||
} | |||
|
|||
public function testAggregateWithinTransaction() |
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 decided to add tests for aggregate()
in response to #562 (comment). Best I can tell, there are no problems with aggregate()
, which jives with the underlying libmongoc bug.
8dcc578
to
c930dda
Compare
c930dda
to
48ef262
Compare
@@ -13,7 +13,7 @@ | |||
"php": ">=5.5", | |||
"ext-hash": "*", | |||
"ext-json": "*", | |||
"ext-mongodb": "^1.5.0" | |||
"ext-mongodb": "^1.5.2" |
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.
This ensures that CDRIVER-2744 is in place via libmongoc 1.12.
@derickr: This has been rebased on master, so please review at your leisure. I don't expect the |
// Collection must be created before the transaction starts | ||
$options = ['writeConcern' => new WriteConcern(WriteConcern::MAJORITY)]; | ||
$operation = new CreateCollection($this->getDatabaseName(), $this->getCollectionName(), $options); | ||
$operation->execute($this->getPrimaryServer()); |
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.
These three lines are copied many times, perhaps they should go into a helper function in FunctionalTestCase?
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.
Good idea. I'll make the change and update the PR.
…ransaction This bumps the PHPC requirement to 1.5.2+, since that includes libmongoc 1.12 and CDRIVER-2744.
48ef262
to
ba0b611
Compare
@derickr: I created generic create/drop collection helpers that apply a majority WC when supported by the server. Testing locally, there was no problem using a majority WC with a standalone, but we'll see what Travis says. I left some explicit uses of CreateCollection and DropCollection operations as-is, particularly when they were using custom collection names. |
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.
Travis says OK, and so do I.
See: #562
This is a regression test for CDRIVER-2744. It builds upon #563 (for PHPLIB-373) and may be fixed by either:
I don't think we should merge this while failing and would suggest leaving it open until one of the solutions can be implemented.