MCPcopy Create free account
hub / github.com/taskforcesh/bullmq / testCanPromoteDelayedJobs

Method testCanPromoteDelayedJobs

php/tests/QueueTest.php:261–278  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

259 }
260
261 public function testCanPromoteDelayedJobs(): void
262 {
263 // Add delayed jobs
264 $this->queue->add('delayed-1', ['data' => 1], ['delay' => 60000]);
265 $this->queue->add('delayed-2', ['data' => 2], ['delay' => 60000]);
266 $this->queue->add('delayed-3', ['data' => 3], ['delay' => 60000]);
267
268 $counts = $this->queue->getJobCounts();
269 $this->assertEquals(3, $counts['delayed']);
270
271 // Promote all delayed jobs
272 $this->queue->promoteJobs();
273
274 // Check they moved to waiting
275 $counts = $this->queue->getJobCounts();
276 $this->assertEquals(0, $counts['delayed']);
277 $this->assertGreaterThanOrEqual(3, $counts['waiting']);
278 }
279
280 public function testCanObliterateQueue(): void
281 {

Callers

nothing calls this directly

Calls 3

addMethod · 0.65
promoteJobsMethod · 0.65
getJobCountsMethod · 0.45

Tested by

no test coverage detected