Differential D20412 Diff 48755 src/infrastructure/daemon/workers/__tests__/PhabricatorWorkerTestCase.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/daemon/workers/__tests__/PhabricatorWorkerTestCase.php
<?php | <?php | ||||
final class PhabricatorWorkerTestCase extends PhabricatorTestCase { | final class PhabricatorWorkerTestCase extends PhabricatorTestCase { | ||||
protected function getPhabricatorTestCaseConfiguration() { | protected function getPhabricatorTestCaseConfiguration() { | ||||
return array( | return array( | ||||
self::PHABRICATOR_TESTCONFIG_BUILD_STORAGE_FIXTURES => true, | self::PHABRICATOR_TESTCONFIG_BUILD_STORAGE_FIXTURES => true, | ||||
); | ); | ||||
} | } | ||||
protected function willRunOneTest($test) { | |||||
parent::willRunOneTest($test); | |||||
// Before we run these test cases, clear the queue. After D20412, we may | |||||
// have queued tasks from migrations. | |||||
$task_table = new PhabricatorWorkerActiveTask(); | |||||
$conn = $task_table->establishConnection('w'); | |||||
queryfx( | |||||
$conn, | |||||
'TRUNCATE %R', | |||||
$task_table); | |||||
} | |||||
public function testLeaseTask() { | public function testLeaseTask() { | ||||
$task = $this->scheduleTask(); | $task = $this->scheduleTask(); | ||||
$this->expectNextLease($task, pht('Leasing should work.')); | $this->expectNextLease($task, pht('Leasing should work.')); | ||||
} | } | ||||
public function testMultipleLease() { | public function testMultipleLease() { | ||||
$task = $this->scheduleTask(); | $task = $this->scheduleTask(); | ||||
▲ Show 20 Lines • Show All 197 Lines • Show Last 20 Lines |