2

I am writing a Junit Test for my simple workflow. It gives this error: com.amazonaws.services.simpleworkflow.flow.StartChildWorkflowFailedException: OPEN_CHILDREN_LIMIT_EXCEEDED for workflowExecution....

Here is a brief version of the test code.

@RunWith(FlowBlockJUnit4ClassRunner.class)
public class MyWorkflowImplTest {

@Rule
public WorkflowTest workflowTest = new WorkflowTest();

@Before
public void setUp() {
    MyActivity activities = new MyActivityImp(...);
    workflowTest.addActivitiesImplemetation(activities);
    workflowTest.addWorflowImplementationType(MyWorkflowImpl.class);
}

@Test
public void test() {
    MyWorkflowClient workflow = workflowFactory.getClient();
    Promise<Void> response = workflow.MyFunction();
}

I searched around... A possible solution is that add -noverify to JVM. But it doesn't solve the issue.. Any other advise? Appreciate the help.

potbelly
  • 57
  • 1
  • 9

1 Answers1

0

It looks like this error has nothing to do with number of children: https://github.com/aws/aws-swf-flow-library/blob/master/src/main/java/com/amazonaws/services/simpleworkflow/flow/test/TestGenericWorkflowClient.java#L270

Look at the linked exception for the root cause of the failure.

Maxim Fateev
  • 6,458
  • 3
  • 20
  • 35
  • For instance, when I got the error, I looked through the stack trace and found: Caused by: java.lang.InstantiationException: Caused by: java.lang.NoSuchMethodException: because I didn't have a default constructor defined for the WorkflowImpl class. So it couldn't instantiate it. – banshee.handset Aug 14 '18 at 01:32