Skip to content

Commit 45aac1f

Browse files
test: update RecordJobStartAction tests for atomic queue discovery
Remove markQueueDiscovered() mock expectations as queue discovery now happens atomically within recordStart() transaction.
1 parent 6127b59 commit 45aac1f

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

tests/Unit/Actions/RecordJobStartActionTest.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@
2222
});
2323

2424
it('records job start with all parameters', function () {
25-
$this->queueRepository->shouldReceive('markQueueDiscovered')
26-
->once()
27-
->with('redis', 'default');
28-
25+
// Queue discovery now happens atomically inside recordStart()
2926
$this->repository->shouldReceive('recordStart')
3027
->once()
3128
->with(
@@ -58,10 +55,7 @@
5855
})->group('functional');
5956

6057
it('handles different queue connections', function () {
61-
$this->queueRepository->shouldReceive('markQueueDiscovered')
62-
->once()
63-
->with('database', 'emails');
64-
58+
// Queue discovery now happens atomically inside recordStart()
6559
$this->repository->shouldReceive('recordStart')
6660
->once()
6761
->with(
@@ -83,10 +77,7 @@
8377
it('records start time at execution moment', function () {
8478
Carbon::setTestNow('2024-01-15 14:45:30');
8579

86-
$this->queueRepository->shouldReceive('markQueueDiscovered')
87-
->once()
88-
->with('redis', 'reports');
89-
80+
// Queue discovery now happens atomically inside recordStart()
9081
$this->repository->shouldReceive('recordStart')
9182
->once()
9283
->with(
@@ -106,10 +97,7 @@
10697
})->group('functional');
10798

10899
it('handles job IDs with special characters', function () {
109-
$this->queueRepository->shouldReceive('markQueueDiscovered')
110-
->once()
111-
->with('redis', 'default');
112-
100+
// Queue discovery now happens atomically inside recordStart()
113101
$this->repository->shouldReceive('recordStart')
114102
->once()
115103
->with(

0 commit comments

Comments
 (0)