test(changes): keep opencode transient backfill retryable

This commit is contained in:
777genius 2026-04-28 21:47:52 +03:00
parent c065dc703d
commit 9f785ee3b2

View file

@ -1332,7 +1332,10 @@ describe('ChangeExtractorService', () => {
'utf8' 'utf8'
); );
const backfillOpenCodeTaskLedger = vi.fn(async (input: any) => ({ let backfillAttempt = 0;
const backfillOpenCodeTaskLedger = vi.fn(async (input: any) => {
const outcome = backfillAttempt++ === 0 ? 'transient-error' : 'no-attribution';
return {
schemaVersion: 1, schemaVersion: 1,
providerId: 'opencode', providerId: 'opencode',
teamName: input.teamName, teamName: input.teamName,
@ -1346,10 +1349,13 @@ describe('ChangeExtractorService', () => {
candidateEvents: 0, candidateEvents: 0,
importedEvents: 0, importedEvents: 0,
skippedEvents: 0, skippedEvents: 0,
outcome: 'no-attribution', outcome,
notices: [], notices: [],
diagnostics: [], diagnostics: outcome === 'transient-error'
})); ? ['OpenCode SQLite file changed while snapshot was read; using transaction snapshot.']
: [],
};
});
const workerClient = { const workerClient = {
isAvailable: vi.fn(() => true), isAvailable: vi.fn(() => true),
computeTaskChanges: vi.fn(async () => computeTaskChanges: vi.fn(async () =>