diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9aa4e1..e865661 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -121,10 +121,11 @@ jobs: dotnet run --endpoint ${{ env.Grpc__Endpoint }} --taskId ${{ env.taskId }} --dataFolder /tmp/test - name: Run Worker HtcMock + working-directory: src/TaskReRunner run: | mkdir /tmp/sockets chmod 777 /tmp/sockets - docker run --rm -d --name htcmock -u $(id -u) -e ComputePlane__WorkerChannel__Address=/cache/worker.sock -e ComputePlane__AgentChannel__Address=/cache/agent.sock -v /tmp/sockets:/cache -v /tmp/Results:/tmp/Results dockerhubaneo/armonik_core_htcmock_test_worker:0.25.0 + docker run --rm -d --name htcmock -u $(id -u) -e ComputePlane__WorkerChannel__Address=/cache/worker.sock -e ComputePlane__AgentChannel__Address=/cache/agent.sock -v /tmp/sockets:/cache -v /tmp/test:/tmp/test -v ${{ github.workspace }}:${{ github.workspace }} dockerhubaneo/armonik_core_htcmock_test_worker:0.25.0 - name: Run TaskReRunner working-directory: src/TaskReRunner diff --git a/src/TaskDumper/Program.cs b/src/TaskDumper/Program.cs index 21eaf41..ed01b1e 100644 --- a/src/TaskDumper/Program.cs +++ b/src/TaskDumper/Program.cs @@ -329,12 +329,19 @@ await File.WriteAllTextAsync(folder + "Subtasks.json", await foreach (var result in resultsCreated) { results[result.ResultId] = result; + var createdResponse = resultClient.GetResult(new GetResultRequest + { + ResultId = taskResponse.Task.PayloadId, + }); // Put subtask results in var folder + "Results" - await File.WriteAllBytesAsync(Path.Combine(folder + "Results", - result.ResultId), - await resultClient.DownloadResultData(taskResponse.Task.SessionId, - result.ResultId, - CancellationToken.None) ?? Encoding.ASCII.GetBytes("")); + if (createdResponse.Result.Status == ResultStatus.Completed) + { + await File.WriteAllBytesAsync(Path.Combine(folder + "Results", + result.ResultId), + await resultClient.DownloadResultData(taskResponse.Task.SessionId, + result.ResultId, + CancellationToken.None) ?? Encoding.ASCII.GetBytes("")); + } } await File.WriteAllTextAsync(folder + "CreatedResults.json",