Merge "Remove useless sleep() in JobQueueTest"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 24 Oct 2014 16:46:08 +0000 (16:46 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 24 Oct 2014 16:46:08 +0000 (16:46 +0000)
tests/phpunit/includes/jobqueue/JobQueueTest.php

index 69e4006..ea1a4f6 100644 (file)
@@ -247,8 +247,13 @@ class JobQueueTest extends MediaWikiTestCase {
                        $this->assertNull( $queue->push( $this->newJob( 0, $root1 ) ), "Push worked ($desc)" );
                }
                $queue->deduplicateRootJob( $this->newJob( 0, $root1 ) );
-               sleep( 1 ); // roo job timestamp will increase
-               $root2 = Job::newRootJobParams( "nulljobspam:$id" ); // task ID/timestamp
+
+               $root2 = $root1;
+               # Add a second to UNIX epoch and format back to TS_MW
+               $root2_ts = strtotime( $root2['rootJobTimestamp'] );
+               $root2_ts++;
+               $root2['rootJobTimestamp'] = wfTimestamp( TS_MW, $root2_ts );
+
                $this->assertNotEquals( $root1['rootJobTimestamp'], $root2['rootJobTimestamp'],
                        "Root job signatures have different timestamps." );
                for ( $i = 0; $i < 5; ++$i ) {