-
Notifications
You must be signed in to change notification settings - Fork 327
PHP-1510: Fix tests for legacy opcode rerouting #877
Changes from all commits
419ccbe
ba9c5d7
f9d8e51
16c9a1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,14 +8,14 @@ Test for PHP-1085: w=0 returns unexpected exception on failure (socketTimeoutMS | |
|
||
require_once "tests/utils/server.inc"; | ||
|
||
function assertFalse($value) { | ||
function assertTrue($value) { | ||
if ( ! is_bool($value)) { | ||
printf("Expected boolean type but received %s\n", gettype($value)); | ||
return; | ||
} | ||
|
||
if ($value !== false) { | ||
echo "Expected boolean false but received boolean true\n"; | ||
if ($value !== true) { | ||
echo "Expected boolean true but received boolean false\n"; | ||
} | ||
} | ||
|
||
|
@@ -34,7 +34,7 @@ for ($i = 0; $i < 10; ++$i) { | |
array('x' => $i, 'y' => str_repeat('a', 4*1024*1024)), | ||
array('w' => 0) | ||
); | ||
assertFalse($retval); | ||
assertTrue($retval); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From the commit message:
|
||
} | ||
|
||
echo "Testing update() with w=0\n"; | ||
|
@@ -44,15 +44,15 @@ $retval = $collection->update( | |
array('$set' => array('y' => 1)), | ||
array('w' => 0) | ||
); | ||
assertFalse($retval); | ||
assertTrue($retval); | ||
|
||
echo "Testing remove() with w=0\n"; | ||
|
||
$retval = $collection->remove( | ||
array('$where' => 'sleep(1) && false'), | ||
array('w' => 0) | ||
); | ||
assertFalse($retval); | ||
assertTrue($retval); | ||
|
||
echo "Testing update() with w=1\n"; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,12 +47,11 @@ dump_writeConcern($mn); | |
|
||
echo "Setting it to false, per-query, and w=0 to force no-gle\n"; | ||
$doc = array("doc" => "ument"); | ||
printLogs(MongoLog::IO, MongoLog::FINE, '/is_gle_op/'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From the commit message:
|
||
$mc->test->bug572->insert($doc, array("fsync" => false, "w" => 0)); | ||
dump_writeConcern($mn); | ||
$mc->test->bug572->update(array("_id" => $doc["_id"]), array("updated" => "doc"), array("fsync" => false, "w" => 0)); | ||
dump_writeConcern($mn); | ||
$mc->test->bug572->remove(array("_id" => $doc["_id"]), array("fsync" => false, "w" => 0)); | ||
dump_writeConcern($mn); | ||
MongoLog::setLevel(MongoLog::NONE); | ||
|
||
$mc = new MongoClient($host, array("fsync" => false), array("context" => $ctx)); | ||
|
||
|
@@ -78,12 +77,11 @@ $mc = new MongoClient($host, array("fsync" => false, "w" => 0), array("context" | |
|
||
echo "Fsync disabled by default, and gle\n"; | ||
$doc = array("doc" => "ument"); | ||
printLogs(MongoLog::IO, MongoLog::FINE, '/is_gle_op/'); | ||
$mc->test->bug572->insert($doc); | ||
dump_writeConcern($mn); | ||
$mc->test->bug572->update(array("_id" => $doc["_id"]), array("updated" => "doc")); | ||
dump_writeConcern($mn); | ||
$mc->test->bug572->remove(array("_id" => $doc["_id"])); | ||
dump_writeConcern($mn); | ||
MongoLog::setLevel(MongoLog::NONE); | ||
|
||
echo "Setting it to true, per-query, with gle=0\n"; | ||
$doc = array("doc" => "ument"); | ||
|
@@ -135,24 +133,9 @@ array(2) { | |
int(1) | ||
} | ||
Setting it to false, per-query, and w=0 to force no-gle | ||
array(2) { | ||
["fsync"]=> | ||
bool(false) | ||
["w"]=> | ||
int(0) | ||
} | ||
array(2) { | ||
["fsync"]=> | ||
bool(false) | ||
["w"]=> | ||
int(0) | ||
} | ||
array(2) { | ||
["fsync"]=> | ||
bool(false) | ||
["w"]=> | ||
int(0) | ||
} | ||
is_gle_op: no | ||
is_gle_op: no | ||
is_gle_op: no | ||
Fsync disabled by default | ||
array(2) { | ||
["fsync"]=> | ||
|
@@ -192,24 +175,9 @@ array(2) { | |
int(1) | ||
} | ||
Fsync disabled by default, and gle | ||
array(2) { | ||
["fsync"]=> | ||
bool(false) | ||
["w"]=> | ||
int(0) | ||
} | ||
array(2) { | ||
["fsync"]=> | ||
bool(false) | ||
["w"]=> | ||
int(0) | ||
} | ||
array(2) { | ||
["fsync"]=> | ||
bool(false) | ||
["w"]=> | ||
int(0) | ||
} | ||
is_gle_op: no | ||
is_gle_op: no | ||
is_gle_op: no | ||
Setting it to true, per-query, with gle=0 | ||
array(2) { | ||
["fsync"]=> | ||
|
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.
From the commit message: