From e9aa72d6dfe6f675973d65fac1a3e472943f99c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gurhem?= Date: Fri, 24 May 2024 17:44:58 +0200 Subject: [PATCH 1/2] fix: Default value for Task Output when creating task --- Common/src/Storage/TaskLifeCycleHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/src/Storage/TaskLifeCycleHelper.cs b/Common/src/Storage/TaskLifeCycleHelper.cs index ef4eaebb5..670b602e0 100644 --- a/Common/src/Storage/TaskLifeCycleHelper.cs +++ b/Common/src/Storage/TaskLifeCycleHelper.cs @@ -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); From f6d4caad8417cfd912f7d410a2ea75d8d90cd554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gurhem?= Date: Fri, 24 May 2024 18:27:11 +0200 Subject: [PATCH 2/2] fix: wait for tasks to finish in submitter tests from stream wrapper --- Tests/Stream/Client/StreamWrapperTests.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Tests/Stream/Client/StreamWrapperTests.cs b/Tests/Stream/Client/StreamWrapperTests.cs index 16e7424c6..290b104c6 100644 --- a/Tests/Stream/Client/StreamWrapperTests.cs +++ b/Tests/Stream/Client/StreamWrapperTests.cs @@ -214,6 +214,12 @@ public async Task Square(int input) }) .ConfigureAwait(false); + await client_!.WaitForAvailabilityAsync(new ResultRequest + { + ResultId = expectedOutput, + Session = sessionId, + }); + var resultRequest = new TaskOutputRequest { TaskId = taskIds.Single(), @@ -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