Merge remote-tracking branch 'origin/main' into next

This commit is contained in:
github-actions[bot]
2026-08-19 14:47:36 +00:00
2 changed files with 56 additions and 0 deletions
+22
View File
@@ -64,3 +64,25 @@ it('creates a failed execution record when server is force disabled', function (
->and($execution->status)->toBe('failed')
->and($execution->message)->toContain('not functional');
});
it('finishes the latest running execution when the job fails after a timeout', function () {
$user = User::factory()->create();
$team = $user->teams()->first();
$server = Server::factory()->create(['team_id' => $team->id]);
$olderExecution = DockerCleanupExecution::create([
'server_id' => $server->id,
]);
$timedOutExecution = DockerCleanupExecution::create([
'server_id' => $server->id,
]);
$job = new DockerCleanupJob($server);
$job->failed(new RuntimeException('Docker cleanup job has timed out.'));
expect($timedOutExecution->refresh()->status)->toBe('failed')
->and($timedOutExecution->message)->toBe('Docker cleanup job has timed out.')
->and($timedOutExecution->finished_at)->not->toBeNull()
->and($olderExecution->refresh()->status)->toBe('running')
->and($olderExecution->finished_at)->toBeNull();
});