From 73c6f525e0fa798642a389e478a5848f1dfe09bb Mon Sep 17 00:00:00 2001 From: Christian Aistleitner Date: Fri, 20 Feb 2015 00:42:31 +0100 Subject: [PATCH] Fix and re-enable Dumps' checkpoint tests It seems that fread can now bring 0.5MB into a buffer at once. That recently made the checkpoint tests erratic, as they relied on the backupTestPass.inc dump reading loop taking at least two rounds, as only the second round can trigger creating the second checkpoint file. By taking advantage of the just added parameter to set the buffer size, we lower the used buffer size for the tests. Thereby, we force more than one iteration of the dump reading loop, and finally make the tests pass again reliably. Hence, the tests get enabled again. Bug: T70653 Change-Id: I4449b42558ada8bd579a33b651f2a630a47bfe1c --- tests/phpunit/maintenance/backupTextPassTest.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/phpunit/maintenance/backupTextPassTest.php b/tests/phpunit/maintenance/backupTextPassTest.php index 8ed8e1068f..a5ef762488 100644 --- a/tests/phpunit/maintenance/backupTextPassTest.php +++ b/tests/phpunit/maintenance/backupTextPassTest.php @@ -244,7 +244,9 @@ class TextPassDumperDatabaseTest extends DumpTestCase { $this->fail( "Could not open stream for stderr" ); } - $iterations = 32; // We'll start with that many iterations of revisions in stub + $iterations = 32; // We'll start with that many iterations of revisions + // in stub. Make sure that the generated volume is above the buffer size + // set below. Otherwise, the checkpointing does not trigger. $lastDuration = 0; $minDuration = 2; // We want the dump to take at least this many seconds $checkpointAfter = 0.5; // Generate checkpoint after this many seconds @@ -262,6 +264,7 @@ class TextPassDumperDatabaseTest extends DumpTestCase { $dumper = new TextPassDumper( array( "--stub=file:" . $nameStub, "--output=" . $checkpointFormat . ":" . $nameOutputDir . "/full", "--maxtime=1" /*This is in minutes. Fixup is below*/, + "--buffersize=32768", // The default of 32 iterations fill up 32KB about twice "--checkpointfile=checkpoint-%s-%s.xml.gz" ) ); $dumper->setDb( $this->db ); $dumper->maxTimeAllowed = $checkpointAfter; // Patching maxTime from 1 minute @@ -415,10 +418,7 @@ class TextPassDumperDatabaseTest extends DumpTestCase { } /** - * Broken per T70653. - * * @group large - * @group Broken */ function testCheckpointPlain() { $this->checkpointHelper(); @@ -434,10 +434,7 @@ class TextPassDumperDatabaseTest extends DumpTestCase { * PHP extensions, we go for gzip instead, which triggers the same relevant code * paths while still being testable on more systems. * - * Broken per T70653. - * * @group large - * @group Broken */ function testCheckpointGzip() { $this->checkHasGzip(); -- 2.20.1