chore: address cubic comment

This commit is contained in:
Charlie Lamb
2026-04-24 17:53:39 +01:00
parent bb6e2f5136
commit 2185aaf994
4 changed files with 73 additions and 8 deletions

View File

@@ -0,0 +1,27 @@
import { describe, expect, test } from "bun:test";
import { RedisUnavailableError } from "@/external/redis/utils/errors.js";
import { JobName } from "@/queue/JobName.js";
import { shouldRetrySqsJobError } from "@/queue/processMessage.js";
describe("shouldRetrySqsJobError", () => {
test("retries track jobs on transient Redis errors", () => {
expect(
shouldRetrySqsJobError({
jobName: JobName.Track,
error: new RedisUnavailableError({
source: "runTrackV3",
reason: "timeout",
}),
}),
).toBe(true);
});
test("does not retry track jobs on non-transient application errors", () => {
expect(
shouldRetrySqsJobError({
jobName: JobName.Track,
error: new Error("insufficient balance"),
}),
).toBe(false);
});
});