public Optional<StepAction> tryGetAction(WorkflowSummary summary, String stepId) {
    try {
      return getAction(summary, stepId);
    } catch (RuntimeException ae) {
      // treat it as no action and will check the action again in the next cycle
      LOG.warn(
          "tryUpdateByAction will check the action again in the next turn due to exception ", ae);
      return Optional.empty();
    }
  }
@Test
  public void testTryGetActionWithError() throws Exception {
    DataSource dataSource1 = spy(dataSource);
    MaestroStepInstanceActionDao actionDao1 =
        new MaestroStepInstanceActionDao(dataSource1, MAPPER, config, stepInstanceDao, publisher);
    doThrow(new RuntimeException("test-exception")).when(dataSource1).getConnection();

    WorkflowSummary summary = new WorkflowSummary();
    summary.setWorkflowId("sample-dag-test-3");
    summary.setWorkflowInstanceId(1);
    summary.setWorkflowRunId(1);
    Optional<StepAction> stepAction = actionDao1.tryGetAction(summary, "job1");
    Assert.assertFalse(stepAction.isPresent());
  }