Merge task branch for: fix(worker): FailAsync-Guard untersuchen — ist Queued→Failed erreichbar/gewollt?
This commit is contained in:
@@ -232,6 +232,21 @@ public sealed class TaskStateServiceTests : IDisposable
|
||||
Assert.Equal("boom", t.Result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task FailAsync_FromQueued_TransitionsToFailed()
|
||||
{
|
||||
// OverrideSlotService can call MarkFailed before StartRunningAsync when a
|
||||
// preflight step (list lookup, worktree setup) fails — the task is still Queued.
|
||||
var id = await SeedTaskAsync(TaskStatus.Queued);
|
||||
|
||||
var result = await _sut.FailAsync(id, DateTime.UtcNow, "list not found", default);
|
||||
|
||||
Assert.True(result.Ok);
|
||||
var t = await GetTaskAsync(id);
|
||||
Assert.Equal(TaskStatus.Failed, t.Status);
|
||||
Assert.Equal("list not found", t.Result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task FailAsync_FromDone_Rejects()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user