Skip to content

Commit

Permalink
[Backport 2.x] Fix max workflows setting test (opensearch-project#286)
Browse files Browse the repository at this point in the history
Fix max workflows setting test (opensearch-project#268)


(cherry picked from commit 551e768)

Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent d2d2143 commit 9a50b80
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

/**
* Abstract class to handle search request.
* @param <T> The type to search
*/
public abstract class AbstractSearchWorkflowAction<T extends ToXContentObject> extends BaseRestHandler {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*/
public class NoOpStep implements WorkflowStep {

/** Instantiate this class */
public NoOpStep() {}

/** The name of this step, used as a key in the template and the {@link WorkflowStepFactory} */
public static final String NAME = "noop";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void setUp() throws Exception {
super.setUp();
threadPool = mock(ThreadPool.class);
settings = Settings.builder()
.put("plugins.flow_framework.max_workflows.", 2)
.put("plugins.flow_framework.max_workflows", 2)
.put("plugins.flow_framework.request_timeout", TimeValue.timeValueSeconds(10))
.build();
this.flowFrameworkIndicesHandler = mock(FlowFrameworkIndicesHandler.class);
Expand Down Expand Up @@ -196,7 +196,7 @@ public void testMaxWorkflow() {
createWorkflowTransportAction.doExecute(mock(Task.class), workflowRequest, listener);
ArgumentCaptor<Exception> exceptionCaptor = ArgumentCaptor.forClass(Exception.class);
verify(listener, times(1)).onFailure(exceptionCaptor.capture());
assertEquals(("Maximum workflows limit reached 1000"), exceptionCaptor.getValue().getMessage());
assertEquals(("Maximum workflows limit reached 2"), exceptionCaptor.getValue().getMessage());
}

public void testMaxWorkflowWithNoIndex() {
Expand Down

0 comments on commit 9a50b80

Please sign in to comment.