Fix and re-enable Dumps' checkpoint tests
authorChristian Aistleitner <christian@quelltextlich.at>
Thu, 19 Feb 2015 23:42:31 +0000 (00:42 +0100)
committerChristian Aistleitner <christian@quelltextlich.at>
Thu, 19 Feb 2015 23:56:40 +0000 (00:56 +0100)
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

index 8ed8e10..a5ef762 100644 (file)
@@ -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();