Keep similar-ai from tripping the global circuit on a lone URL 502, clamp Qdrant search to 100, and add Server-Timing plus slow-request logging. Studio shared props, Academy S3 exists caching, heat chunking, and Redis/scheduler hygiene stay in this rollout.
46 lines
1.2 KiB
PHP
46 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Unit\Jobs;
|
|
|
|
use App\Jobs\RecComputeSimilarHybridJob;
|
|
use Illuminate\Queue\Middleware\WithoutOverlapping;
|
|
use Tests\TestCase;
|
|
|
|
final class RecComputeSimilarHybridJobTest extends TestCase
|
|
{
|
|
public function test_job_uses_single_attempt_to_avoid_retry_loop_failures(): void
|
|
{
|
|
$job = new RecComputeSimilarHybridJob(123);
|
|
|
|
$this->assertSame(1, $job->tries);
|
|
}
|
|
|
|
public function test_artwork_specific_jobs_use_without_overlapping_middleware(): void
|
|
{
|
|
$job = new RecComputeSimilarHybridJob(123);
|
|
$middleware = $job->middleware();
|
|
|
|
$this->assertCount(1, $middleware);
|
|
$this->assertInstanceOf(WithoutOverlapping::class, $middleware[0]);
|
|
}
|
|
|
|
public function test_batch_jobs_do_not_use_without_overlapping_middleware(): void
|
|
{
|
|
$job = new RecComputeSimilarHybridJob(null, 200);
|
|
|
|
$this->assertSame([], $job->middleware());
|
|
}
|
|
|
|
public function test_job_timeout_stays_below_queue_retry_after(): void
|
|
{
|
|
$job = new RecComputeSimilarHybridJob();
|
|
|
|
$this->assertLessThan(
|
|
(int) config('queue.connections.redis.retry_after'),
|
|
$job->timeout,
|
|
);
|
|
}
|
|
}
|