Skip to content

Commit

Permalink
fix: Default value for Task Output when creating task (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
lemaitre-aneo authored May 27, 2024
2 parents c1a6a58 + f6d4caa commit 4a53e2e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Common/src/Storage/TaskLifeCycleHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ public static async Task CreateTasks(ITaskTable taskTable,
TaskStatus.Creating,
request.Options ??
throw new ArmoniKException("Task Options should not be null here"),
new Output(OutputStatus.Error,
"Task Options should not be null here"))),
new Output(OutputStatus.Success,
""))),
cancellationToken)
.ConfigureAwait(false);

Expand Down
16 changes: 16 additions & 0 deletions Tests/Stream/Client/StreamWrapperTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ public async Task<int> Square(int input)
})
.ConfigureAwait(false);

await client_!.WaitForAvailabilityAsync(new ResultRequest
{
ResultId = expectedOutput,
Session = sessionId,
});

var resultRequest = new TaskOutputRequest
{
TaskId = taskIds.Single(),
Expand Down Expand Up @@ -274,6 +280,16 @@ public async Task TaskFailed()
taskRequests)
.ConfigureAwait(false);

foreach (var request in taskRequests)
{
await client_!.WaitForAvailabilityAsync(new ResultRequest
{
ResultId = request.ExpectedOutputKeys.Single(),
Session = sessionId,
})
.ConfigureAwait(false);
}

var taskOutput = taskIds.Select(id =>
{
var resultRequest = new TaskOutputRequest
Expand Down

0 comments on commit 4a53e2e

Please sign in to comment.