}
$baseConfig['type'] = 'null';
$baseConfig['domain'] = WikiMap::getCurrentWikiDbDomain()->getId();
+ $baseConfig['stash'] = new HashBagOStuff();
+ $baseConfig['wanCache'] = new WANObjectCache( [ 'cache' => new HashBagOStuff() ] );
$variants = [
'queueRand' => [ 'order' => 'random', 'claimTTL' => 0 ],
'queueRandTTL' => [ 'order' => 'random', 'claimTTL' => 10 ],
$this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" );
$this->assertEquals( 0, $queue->getAcquiredCount(), "Queue is empty ($desc)" );
- $id = wfRandomString( 32 );
- $root1 = Job::newRootJobParams( "nulljobspam:$id" ); // task ID/timestamp
+ $root1 = Job::newRootJobParams( "nulljobspam:testId" ); // task ID/timestamp
for ( $i = 0; $i < 5; ++$i ) {
$this->assertNull( $queue->push( $this->newJob( 0, $root1 ) ), "Push worked ($desc)" );
}
}
function newJob( $i = 0, $rootJob = [] ) {
- return new NullJob( Title::newMainPage(),
+ return Job::factory( 'null', Title::newMainPage(),
[ 'lives' => 0, 'usleep' => 0, 'removeDuplicates' => 0, 'i' => $i ] + $rootJob );
}
function newDedupedJob( $i = 0, $rootJob = [] ) {
- return new NullJob( Title::newMainPage(),
+ return Job::factory( 'null', Title::newMainPage(),
[ 'lives' => 0, 'usleep' => 0, 'removeDuplicates' => 1, 'i' => $i ] + $rootJob );
}
}