Skip to content

Commit

Permalink
Fix: change parameter for different test case
Browse files Browse the repository at this point in the history
Signed-off-by: Junwei Dai <[email protected]>
  • Loading branch information
Junwei Dai committed Sep 6, 2024
1 parent 2262131 commit 0c7c77a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public void testDeployModelTaskFailure() throws IOException, InterruptedExceptio
// Stub getTask for success case
doAnswer(invocation -> {
ActionListener<MLTask> actionListener = invocation.getArgument(1);
MLTask output = MLTask.builder().taskId(taskId).modelId(modelId).state(MLTaskState.COMPLETED).async(false).build();
MLTask output = MLTask.builder().taskId(taskId).modelId(modelId).state(MLTaskState.FAILED).async(false).error("error").build();
actionListener.onResponse(output);
return null;
}).when(machineLearningNodeClient).getTask(any(), any());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,13 @@ public void testRegisterLocalCustomModelTaskFailure() {
// Stub get ml task for failure case
doAnswer(invocation -> {
ActionListener<MLTask> actionListener = invocation.getArgument(1);
MLTask output = MLTask.builder().taskId(taskId).modelId(modelId).state(MLTaskState.COMPLETED).async(false).build();
MLTask output = MLTask.builder()
.taskId(taskId)
.modelId(modelId)
.state(MLTaskState.FAILED)
.error(testErrorMessage)
.async(false)
.build();
actionListener.onResponse(output);
return null;
}).when(machineLearningNodeClient).getTask(any(), any());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,13 @@ public void testRegisterLocalPretrainedModelTaskFailure() {
// Stub get ml task for failure case
doAnswer(invocation -> {
ActionListener<MLTask> actionListener = invocation.getArgument(1);
MLTask output = MLTask.builder().taskId(taskId).modelId(modelId).state(MLTaskState.COMPLETED).async(false).build();
MLTask output = MLTask.builder()
.taskId(taskId)
.modelId(modelId)
.state(MLTaskState.FAILED)
.error(testErrorMessage)
.async(false)
.build();
actionListener.onResponse(output);
return null;
}).when(machineLearningNodeClient).getTask(any(), any());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,13 @@ public void testRegisterLocalSparseEncodingModelTaskFailure() {
// Stub get ml task for failure case
doAnswer(invocation -> {
ActionListener<MLTask> actionListener = invocation.getArgument(1);
MLTask output = MLTask.builder().taskId(taskId).modelId(modelId).state(MLTaskState.COMPLETED).async(false).build();
MLTask output = MLTask.builder()
.taskId(taskId)
.modelId(modelId)
.state(MLTaskState.FAILED)
.error(testErrorMessage)
.async(false)
.build();
actionListener.onResponse(output);
return null;
}).when(machineLearningNodeClient).getTask(any(), any());
Expand Down

0 comments on commit 0c7c77a

Please sign in to comment.