import type { BoundedFixture } from "./types.js";

export const waitRetryKnownBad: BoundedFixture = {
  fixtureId: "bounded/wait-retry-known-bad",
  boundedVersion: "1.0",
  scenarios: [
    {
      scenarioId: "unbounded-lock-wait",
      kind: "wait-retry",
      observation: {
        loopKind: "wait",
        attemptsObserved: Number.POSITIVE_INFINITY,
        elapsedMs: 3_600_000,
        cancellationPathAvailable: false,
        terminalState: "wedged",
        terminalFailureTyped: false,
        statesDistinct: true,
      },
    },
    {
      scenarioId: "unbounded-retry-loop",
      kind: "wait-retry",
      observation: {
        loopKind: "retry",
        attemptsObserved: 10_000,
        elapsedMs: 600_000,
        cancellationPathAvailable: false,
        terminalState: "busy",
        terminalFailureTyped: false,
        statesDistinct: true,
      },
    },
    {
      scenarioId: "wedged-indistinguishable-from-busy",
      kind: "wait-retry",
      observation: {
        loopKind: "wait",
        boundedProgressRule: "poll-every-100ms",
        maxWaitMs: 5_000,
        attemptsObserved: 50,
        elapsedMs: 5_000,
        cancellationPathAvailable: true,
        terminalState: "wedged",
        terminalFailureTyped: false,
        statesDistinct: false,
      },
    },
    {
      scenarioId: "retry-without-terminal-failure",
      kind: "wait-retry",
      observation: {
        loopKind: "retry",
        boundedProgressRule: "fixed-interval-1s",
        maxAttempts: 3,
        attemptsObserved: 3,
        elapsedMs: 3_000,
        cancellationPathAvailable: true,
        terminalState: "none",
        terminalFailureTyped: false,
        statesDistinct: true,
      },
    },
  ],
};
