@Test
public void shouldTolerateCounterCapacityExceptionWhenEmittingEvents() throws Exception {

  // Change the pod status to terminated without notifying the runner through the pod watcher
  var terminatedPod = new PodBuilder(createdPod)
      .withStatus(terminated("Succeeded", 20, null))
      .build();
  when(k8sClient.getPod(POD_NAME)).thenReturn(Optional.of(terminatedPod));
  doThrow(new CounterCapacityException("foo!"))
      .when(stateManager).receive(any(), anyLong());
  verifyZeroInteractions(stateManager);
  // Poll for execution status
  var stateData = StateData.newBuilder().executionId(POD_NAME).build();
  var runState = RunState.create(WORKFLOW_INSTANCE, State.SUBMITTED, stateData);
  kdr.poll(runState);
  verify(stateManager).receive(any(), anyLong());
}