Files
PaperClipAI/server/src/__tests__/native-exhausted-finalization-retry.test.ts
T
DottaandClaude c37eacbee3 fix(native): Retry re-finalizes a saved result that ran out of finalization retries (#20578)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Native runs save an accepted result. Then a finalizer applies that
result to the task.
> - Finalization has its own budget of 3 failed attempts (#20555). When
the budget runs out, the coordinator goes to `terminal_failure` with
`native_finalization_retry_exhausted`.
> - For a provider-succeeded run, the task then rests `in_review` with a
board recovery card. The task shows "resolved" and offers no Retry. The
user is stuck.
> - The ordinary Retry is also wrong here: it starts a new provider run,
which repeats work the agent already finished.
> - This pull request adds two things. First, contention failures on
such a result get two longer automatic delays before the board gets the
task. Second, when the state is still exhausted, the task offers Retry,
and that Retry applies the same saved result again.
> - The benefit: fewer tasks need a Retry, and when one does, Retry
works and does no duplicate provider work.

## Linked Issues or Issue Description

Refs #20555 (it names this gap under Risks).

**What happened?**
In restart-chaos wave `w-20261110T044338-s20385`, task t03 ended with a
succeeded run, an accepted result, and a coordinator in
`terminal_failure` / `native_finalization_retry_exhausted`. The issue
stayed `in_review` with a board-owned `active_run_watchdog` card and
`canRetry=false`. #20555 stopped the early exhaustion. A real exhaustion
still leaves the same stuck state. Coordinators that older builds
already left in this state are stuck the same way.

**Expected behavior**
Transient finalization failures recover by themselves when that is safe.
When they do not, the task offers Retry. That Retry re-finalizes the
saved result. It does not start a provider run and does not charge a
provider attempt.

**Steps to reproduce**
1. Let a native run save an accepted result and end `succeeded`.
2. Make each finalization of that result fail until the budget of 3 runs
out.
3. Before this fix, the task presentation is `resolved` with
`canRetry=false`, and the board card has no action that applies the
result. The new test
`server/src/__tests__/native-exhausted-finalization-retry.test.ts`
reproduces this.

**Paperclip version or commit**
master at c58356003f (after #20555).

## What Changed

- `native-run-finalizer.ts` (`recordRetryableFailure`): when the budget
runs out on an accepted result of a provider-succeeded run, and the
cause is contention (`status_cas_exhausted` or
`side_effect_planning_failed`), the coordinator stays
`retryable_failure`. It tries again after 2 minutes, then after 10
minutes, each with a fresh budget. Each delay is recorded once in
`recoveryHistory` (`automatic_finalization_backoff`). After both delays,
the old terminal path runs. Deterministic causes (for example
`native_finalization_invalid`) and workspace-scope failures are
unchanged. The existing deadline worker (`native-result-commit-work`)
runs the retry, so no new timer or poll is added.
- New `native-runtime/exhausted-finalization-retry.ts`:
- `exhaustedNativeFinalizationCondition()`: one SQL predicate for
"succeeded native run, accepted result, coordinator `terminal_failure`
with `native_finalization_retry_exhausted`, no lease, no successor".
- `rearmExhaustedNativeFinalization()`: under the task lock, reopens the
same coordinator (`arbitrating` or `workspace_finalizing`), records
`exhausted_finalization_retry` in `recoveryHistory`, resolves the board
card (`handed_back`), and resets `finalizationFailureCount` to 0. It
sets a 30 s fallback `nextAttemptAt`, so the deadline worker finishes
the job if the process stops first.
- `refinalizeSavedNativeResult()`: runs `finalizeNativeRun` for the same
run with `preserveProviderAttempt: true`. A failure goes through the
finalizer's normal bounded budget.
- `task-interruption-presentation.ts`: the run read adds
`nativeFinalizationRetry` from that predicate. A succeeded run with this
flag shows `state: "failed"`, `canRetry: true`. It also adds
`nativeFinalizationRetryPending` (`savedResultRetryPendingCondition()`:
coordinator not committed or terminal, with an
`exhausted_finalization_retry` entry). While it is true the task shows
`state: "working"` with `recoveryStep: "finishing_recovery"`, so the
user sees the Retry took effect. Done or cancelled tasks, user gates,
and ordinary runs are unchanged.
- `task-retry.ts` (`admitTaskRetry`): for a succeeded native run in the
exhausted state, Retry re-arms the coordinator instead of creating a
provider retry. It writes a `coalesced` `task_retry` receipt bound to
the same run with strategy `finalize_result` (an existing strategy
value), joins any unadmitted Retry intent to it, and logs
`issue.retry_requested` with `strategy: "finalize_result"`. The
idempotency key still returns the same receipt on replay. A later click
with a new key, after an earlier saved-result Retry of the same run
(still finalizing, or applied), joins that Retry with another coalesced
`finalize_result` receipt and starts no provider work.
- `routes/issues.ts` (`POST /issues/:id/retry`): after the receipt
commits, it starts `refinalizeSavedNativeResult` for that run instead of
the provider Retry dispatch.
- `doc/execution-semantics.md`: documents the automatic delays and the
re-finalizing Retry.

## Verification

- `cd server && npx vitest run
src/__tests__/native-exhausted-finalization-retry.test.ts` (4 tests):
- Exhausted state reports `state: "failed"`, `canRetry: true`. Retry
re-arms the coordinator, writes a `finalize_result` receipt and an
`issue.retry_requested` activity row, and replays idempotently. A second
click with a new key while pending, and a third after commit, join the
same Retry; no provider Retry wake exists. While pending, the task shows
`working` / `finishing_recovery`. Re-finalization commits, and the task
shows resolved. The run count for the task stays 1, the coordinator
`attempt` is unchanged, the run stays `succeeded`, and no board card
stays active.
- Old-shape row (no `finalizationFailureCount`, `attempt: 3`, already
terminal): the same Retry works with no migration.
- Re-finalization that fails again: the coordinator goes to
`retryable_failure` with a fresh count of 1, then to `terminal_failure`
after the budget, and the task again shows `canRetry: true`. Nothing is
lost silently.
- Contention failures (failpoint `status_projection`): two automatic
delays (2 min, 10 min) with the task status unchanged, then the board
Retry, which commits with no new run.
- Red/green: with only the new module and test applied (finalizer,
presentation, task Retry, and route reverted), all 4 tests fail
(`canRetry` false; no automatic delay).
- `npx vitest run src/services/task-interruption-presentation.test.ts`
adds unit cases: the flag offers Retry; ordinary succeeded runs stay
resolved; ordinary failed runs keep `canRetry: true`; done tasks stay
resolved.
- Also passing: `native-finalization-retry-budget`,
`native-finalization-recovery`, `native-run-finalizer-telemetry`,
`task-interruption-query`, `interrupted-preparation-restore-retry`,
`native-result-commit-work`, `workspace-recovery-admission`,
`workspace-recovery-preparation-gates`,
`deferred-execution-receipt-work`.
- `npx tsc --noEmit -p server/tsconfig.json` passes.
- Not run: the full local suite (`pnpm verify` selects about 2,450 files
for these shared modules; CI covers it), and no live restart-chaos wave.

## Risks

- Previous-release story: coordinators saved by older builds in
`terminal_failure` / `native_finalization_retry_exhausted` qualify by
phase and code. The count is optional. Nothing is migrated. Older rows
do not get the automatic delays; they get the working Retry.
- Automatic delays add at most two extra finalization rounds of the same
saved result, only for contention causes, only for provider-succeeded
accepted results. During the delays the task keeps its prior status, as
it does during the normal 30 s retries. Supersession by a newer run is
still checked first on every attempt.
- The re-finalizing Retry applies the agent's saved result after a
person may have looked at the task in review. It uses the normal status
arbiter and CAS. Done and cancelled tasks, other assignees, and newer
runs refuse it.
- No change before `turn.start`: all new work is on the finalization,
presentation, and Retry paths.

> For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and
discuss it in `#dev` before opening the PR. Feature PRs that overlap
with planned core work may need to be redirected — check the roadmap
first. See `CONTRIBUTING.md`.

## Model Used

- Anthropic Claude, model ID `claude-opus-5-5`, used through Claude Code
with tool use (shell, code editing, test execution).

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 11:48:47 -06:00

247 lines
15 KiB
TypeScript

import { resolveExternalTestDatabaseUrl } from "./helpers/external-test-database.js";
import { afterAll, beforeAll, describe, expect, it } from "vitest";
import { and, eq, sql } from "drizzle-orm";
import {
activityLog,
agents,
agentWakeupRequests,
companies,
completionContracts,
createDb,
heartbeatRuns,
issueRecoveryActions,
issues,
nativeRunFinalizations,
nativeRunResults,
workspaceOperations,
} from "@paperclipai/db";
import {
CONTROL_PLANE_CONFORMANCE_OPEN,
CONTROL_PLANE_CONFORMANCE_RESULT,
CONTROL_PLANE_CONFORMANCE_TERMINAL,
} from "../vendor/paperclip-runner/testing.js";
import { startEmbeddedPostgresTestDatabase } from "./helpers/embedded-postgres.js";
import { reconcileNativeFinalizations } from "../services/native-runtime/native-finalization-reconciler.js";
import { finalizeNativeRun, NATIVE_FINALIZATION_AUTOMATIC_BACKOFF_MS } from "../services/native-runtime/native-run-finalizer.js";
import { refinalizeSavedNativeResult } from "../services/native-runtime/exhausted-finalization-retry.js";
import { PaperclipControlPlanePort } from "../services/native-runtime/paperclip-control-plane-port.js";
import { taskInterruptionPresentation } from "../services/task-interruption-presentation.js";
import { requestTaskRetry } from "../services/task-retry.js";
const external = resolveExternalTestDatabaseUrl("PAPERCLIP_NATIVE_FINALIZATION_TEST_DATABASE_URL");
// A provider-succeeded native run whose accepted result could not be applied
// to its task used to rest in review with a board recovery card and no Retry.
// Retry must apply the same saved result again, never start a provider run.
describe("Retry after native finalization runs out of retries", () => {
let temporary: Awaited<ReturnType<typeof startEmbeddedPostgresTestDatabase>>;
let db: ReturnType<typeof createDb>;
const companyId = "72200000-0000-4000-8000-000000000001";
const agentId = "72200000-0000-4000-8000-000000000002";
const userId = "board-user";
let seq = 0;
beforeAll(async () => {
if (!external) temporary = await startEmbeddedPostgresTestDatabase("paperclip-native-exhausted-retry-");
db = createDb(external ?? temporary.connectionString);
await db.insert(companies).values({ id: companyId, name: "Exhausted finalization", issuePrefix: "NEF" });
await db.insert(agents).values({ id: agentId, companyId, name: "Finalizing agent", adapterType: "codex_local", status: "running" });
}, 30_000);
afterAll(async () => {
await db?.$client.end({ timeout: 1 });
await temporary?.cleanup();
});
async function seedAcceptedRun(options: { brokenResult?: boolean } = {}) {
seq += 1;
const id = (n: number) => `72200000-0000-4000-8${String(seq).padStart(3, "0")}-${String(n).padStart(12, "0")}`;
const issueId = id(1), contractId = id(2), runId = id(3);
await db.insert(issues).values({ id: issueId, companyId, title: `Finalize saved result ${seq}`, status: "in_progress",
assigneeAgentId: agentId, workMode: "standard" });
await db.insert(completionContracts).values({
id: contractId, companyId, issueId, revision: 1,
schemaVersion: "paperclip.completion-contract.v1", policyVersion: "phase6-v1", risk: "standard",
completionAuthority: "server_arbiter", incompleteCriteriaPolicy: "preserve_non_terminal",
contractJson: { revision: "phase6-v1", objective: "Finalize the saved result",
criteria: [{ id: "objective", requirement: "The saved result is applied" }] },
canonicalSha256: `exhausted-contract-${seq}`, createdByActorType: "system", createdByActorId: "test",
});
await db.insert(heartbeatRuns).values({
id: runId, companyId, agentId, status: "running", runtimeMode: "native",
runtimeModeReason: "persisted_before_kill_switch", nativeIssueId: issueId, nativeSessionId: runId,
runnerInstanceId: contractId, completionContractId: contractId,
completionContractSha256: `exhausted-contract-${seq}`, contextSnapshot: { issueId },
});
const port = new PaperclipControlPlanePort(db, {
companyId, issueId, runId, agentId, sessionId: runId, completionContractId: contractId,
completionContractSha256: `exhausted-contract-${seq}`, sourceInstanceId: contractId,
controlPlaneSourceInstanceId: `exhausted-control-${seq}`,
});
await port.openRun({ ...CONTROL_PLANE_CONFORMANCE_OPEN,
identity: { companyId, issueId, runId, agentId, sessionId: runId }, sourceInstanceId: contractId });
await port.completeRun({ result: CONTROL_PLANE_CONFORMANCE_RESULT, terminal: CONTROL_PLANE_CONFORMANCE_TERMINAL,
callerResultId: `exhausted-result-${seq}` });
if (options.brokenResult) await setResultTerminal(runId, "unknown");
await db.insert(workspaceOperations).values({ companyId, heartbeatRunId: runId, issueId,
phase: "workspace_finalize", status: "succeeded" });
return { issueId, runId };
}
async function setResultTerminal(runId: string, runTerminalState: string) {
const stored = await db.select().from(nativeRunResults).where(eq(nativeRunResults.runId, runId)).then(rows => rows[0]!);
await db.update(nativeRunResults).set({ resultJson: { ...(stored.resultJson as Record<string, unknown>),
terminal: { ...CONTROL_PLANE_CONFORMANCE_TERMINAL, runTerminalState } } }).where(eq(nativeRunResults.id, stored.id));
}
/** Three failed finalizations of a deterministic cause: no automatic delay applies. */
async function exhaustFinalization(runId: string) {
for (let attempt = 0; attempt < 3; attempt += 1) {
await db.update(nativeRunFinalizations).set({ nextAttemptAt: new Date(0) }).where(eq(nativeRunFinalizations.runId, runId));
await reconcileNativeFinalizations(db, [runId]);
}
}
const coordinator = (runId: string) => db.select().from(nativeRunFinalizations)
.where(eq(nativeRunFinalizations.runId, runId)).then(rows => rows[0]!);
const issueRow = (issueId: string) => db.select().from(issues).where(eq(issues.id, issueId)).then(rows => rows[0]!);
const runCount = (issueId: string) => db.select({ count: sql<number>`count(*)::int` }).from(heartbeatRuns)
.where(and(eq(heartbeatRuns.companyId, companyId), eq(heartbeatRuns.nativeIssueId, issueId))).then(rows => rows[0]!.count);
const presentation = async (issueId: string) => taskInterruptionPresentation(db, await issueRow(issueId));
const retry = (issueId: string, runId: string, key: string) => requestTaskRetry({ db, companyId, issueId,
actorId: userId, actorSource: "session", idempotencyKey: key, observedRunId: runId });
async function expectStuckButRetryable(issueId: string, runId: string) {
await expect(coordinator(runId)).resolves.toMatchObject({ phase: "terminal_failure",
failureCode: "native_finalization_retry_exhausted" });
await expect(db.select().from(heartbeatRuns).where(eq(heartbeatRuns.id, runId)).then(rows => rows[0]))
.resolves.toMatchObject({ status: "succeeded" });
await expect(issueRow(issueId)).resolves.toMatchObject({ status: "in_review" });
await expect(presentation(issueId)).resolves.toMatchObject({ state: "failed", canRetry: true, observedRunId: runId });
}
it("re-finalizes the saved result on Retry with no new provider run or attempt", async () => {
const { issueId, runId } = await seedAcceptedRun({ brokenResult: true });
await exhaustFinalization(runId);
await expectStuckButRetryable(issueId, runId);
const before = await coordinator(runId);
// The cause clears (as row contention does); the saved result is intact.
await setResultTerminal(runId, CONTROL_PLANE_CONFORMANCE_TERMINAL.runTerminalState);
const receipt = await retry(issueId, runId, "refinalize-1");
expect(receipt).toMatchObject({ accepted: true, stale: false, observedRunId: runId, finalizeRunId: runId });
await expect(retry(issueId, runId, "refinalize-1")).resolves.toMatchObject({ accepted: true, requestId: receipt.requestId });
await expect(coordinator(runId)).resolves.toMatchObject({ phase: "workspace_finalizing", failureCode: null,
recoveryHistory: [expect.objectContaining({ kind: "exhausted_finalization_retry", generationId: receipt.requestId,
previousFailureCode: "native_finalization_retry_exhausted" })] });
await expect(db.select().from(agentWakeupRequests).where(eq(agentWakeupRequests.id, receipt.requestId!)))
.resolves.toEqual([expect.objectContaining({ status: "coalesced", runId,
payload: expect.objectContaining({ taskRetry: expect.objectContaining({ strategy: "finalize_result" }) }) })]);
await expect(db.select().from(activityLog).where(and(eq(activityLog.entityId, issueId),
eq(activityLog.action, "issue.retry_requested")))).resolves.toEqual([expect.objectContaining({
actorType: "user", actorId: userId, runId, details: expect.objectContaining({ strategy: "finalize_result" }) })]);
// A second click (another tab, another user, a new key) joins the pending
// saved-result Retry instead of queueing a provider Retry.
await expect(retry(issueId, runId, "refinalize-2")).resolves.toMatchObject({ accepted: true,
requestId: receipt.requestId, finalizeRunId: runId });
const providerRetries = () => db.select().from(agentWakeupRequests).where(and(
eq(agentWakeupRequests.companyId, companyId), eq(agentWakeupRequests.reason, "task_retry"),
sql`${agentWakeupRequests.payload}->>'issueId' = ${issueId}`,
sql`${agentWakeupRequests.status} <> 'coalesced' or ${agentWakeupRequests.payload}#>>'{taskRetry,strategy}' <> 'finalize_result'`));
await expect(providerRetries()).resolves.toHaveLength(0);
// A finalizer holds the coordinator (and would take the task next). A
// click must join without waiting on it, or the two could deadlock.
await db.transaction(async finalizer => {
await finalizer.select().from(nativeRunFinalizations).where(eq(nativeRunFinalizations.runId, runId)).for("update");
const joined = await Promise.race([retry(issueId, runId, "refinalize-locked"),
new Promise(resolve => setTimeout(() => resolve("blocked on the coordinator lock"), 5_000))]);
expect(joined).toMatchObject({ accepted: true, requestId: receipt.requestId });
});
// The Retry visibly took effect while the saved result is applied.
await expect(presentation(issueId)).resolves.toMatchObject({ state: "working", canRetry: false,
recoveryStep: "finishing_recovery" });
await refinalizeSavedNativeResult(db, { companyId, runId });
// A stale click after the result applied also joins; nothing new runs.
const late = await retry(issueId, runId, "refinalize-3");
expect(late).toMatchObject({ accepted: true, requestId: receipt.requestId });
expect(late).not.toHaveProperty("finalizeRunId");
await expect(providerRetries()).resolves.toHaveLength(0);
const after = await coordinator(runId);
expect(after).toMatchObject({ phase: "committed" });
expect(after.decisionId).toBeTruthy();
expect(after.attempt).toBe(before.attempt);
expect(await runCount(issueId)).toBe(1);
await expect(db.select().from(heartbeatRuns).where(eq(heartbeatRuns.id, runId)).then(rows => rows[0]))
.resolves.toMatchObject({ status: "succeeded", nativePhase: "committed" });
const settled = await presentation(issueId);
expect(settled?.canRetry ?? false).toBe(false);
expect(settled?.state ?? "resolved").toBe("resolved");
await expect(db.select().from(issueRecoveryActions).where(and(eq(issueRecoveryActions.sourceIssueId, issueId),
eq(issueRecoveryActions.status, "active"), eq(issueRecoveryActions.ownerType, "board")))).resolves.toHaveLength(0);
});
it("offers the same Retry for a coordinator an older build left terminal", async () => {
const { issueId, runId } = await seedAcceptedRun({ brokenResult: true });
await exhaustFinalization(runId);
// The previous release's shape: no finalization count, budget judged on provider attempts.
await db.update(heartbeatRuns).set({ resultJson: sql`${heartbeatRuns.resultJson} - 'finalizationFailureCount'` })
.where(eq(heartbeatRuns.id, runId));
await db.update(nativeRunFinalizations).set({ attempt: 3 }).where(eq(nativeRunFinalizations.runId, runId));
await expectStuckButRetryable(issueId, runId);
await setResultTerminal(runId, CONTROL_PLANE_CONFORMANCE_TERMINAL.runTerminalState);
await expect(retry(issueId, runId, "refinalize-old")).resolves.toMatchObject({ finalizeRunId: runId });
await refinalizeSavedNativeResult(db, { companyId, runId });
await expect(coordinator(runId)).resolves.toMatchObject({ phase: "committed", attempt: 3 });
expect(await runCount(issueId)).toBe(1);
});
it("keeps a Retry whose re-finalization fails again bounded and visible", async () => {
const { issueId, runId } = await seedAcceptedRun({ brokenResult: true });
await exhaustFinalization(runId);
await expectStuckButRetryable(issueId, runId);
await expect(retry(issueId, runId, "refinalize-fails")).resolves.toMatchObject({ finalizeRunId: runId });
await refinalizeSavedNativeResult(db, { companyId, runId });
// The click granted a fresh budget: the first failure stays automatic.
await expect(coordinator(runId)).resolves.toMatchObject({ phase: "retryable_failure",
failureCode: "native_finalization_invalid" });
await expect(db.select().from(heartbeatRuns).where(eq(heartbeatRuns.id, runId)).then(rows => rows[0]?.resultJson))
.resolves.toMatchObject({ finalizationFailureCount: 1 });
await expect(presentation(issueId)).resolves.toMatchObject({ state: "working", canRetry: false });
await exhaustFinalization(runId);
await expectStuckButRetryable(issueId, runId);
expect(await runCount(issueId)).toBe(1);
});
it("re-applies a result that lost status races after longer delays before asking for Retry", async () => {
const { issueId, runId } = await seedAcceptedRun();
const failOnce = async () => {
// The quick retries are already spent; the next failure exhausts them.
await db.update(heartbeatRuns).set({ resultJson: sql`coalesce(${heartbeatRuns.resultJson}, '{}'::jsonb)
|| '{"finalizationFailureCount": 2}'::jsonb` }).where(eq(heartbeatRuns.id, runId));
await finalizeNativeRun({ db, runId, workspaceFinalizeStatus: "succeeded", projectRunStatus: true,
failpoint: "status_projection" });
};
for (const delay of NATIVE_FINALIZATION_AUTOMATIC_BACKOFF_MS) {
const started = Date.now();
await failOnce();
const row = await coordinator(runId);
expect(row).toMatchObject({ phase: "retryable_failure", failureCode: "side_effect_planning_failed" });
expect(row.nextAttemptAt!.getTime()).toBeGreaterThanOrEqual(started + delay - 1_000);
await expect(issueRow(issueId)).resolves.toMatchObject({ status: "in_progress" });
await expect(db.select().from(heartbeatRuns).where(eq(heartbeatRuns.id, runId)).then(rows => rows[0]?.resultJson))
.resolves.toMatchObject({ finalizationFailureCount: 0 });
}
// Each delay is used once; then the board gets a working Retry.
await failOnce();
await expectStuckButRetryable(issueId, runId);
await expect(retry(issueId, runId, "refinalize-after-backoff")).resolves.toMatchObject({ finalizeRunId: runId });
await refinalizeSavedNativeResult(db, { companyId, runId });
await expect(coordinator(runId)).resolves.toMatchObject({ phase: "committed" });
expect(await runCount(issueId)).toBe(1);
});
});