@Test public void testFailedStatusUpdate() throws Exception { storageUtil.expectWrite(); CountDownLatch latch = new CountDownLatch(1); expect(stateManager.changeState( storageUtil.mutableStoreProvider, TASK_ID_A, Optional.absent(), RUNNING, Optional.of("fake message"))) .andAnswer(() -> { latch.countDown(); throw new StorageException("Injected error"); }); control.replay(); TaskStatus status = TaskStatus.newBuilder() .setState(TaskState.TASK_RUNNING) .setTaskId(TaskID.newBuilder().setValue(TASK_ID_A)) .setMessage("fake message") .build(); statusHandler.statusUpdate(status); assertTrue(latch.await(5L, TimeUnit.SECONDS)); }
@Override public void statusUpdate(TaskStatus status) { pendingUpdates.add(status); }
TaskStatusHandlerImpl extends AbstractExecutionThreadService implements TaskStatusHandler { @Override public void statusUpdate(TaskStatus status) { pendingUpdates.add(status); } }
TaskStatusHandlerImpl extends AbstractExecutionThreadService implements TaskStatusHandler { @Override public void statusUpdate(TaskStatus status) { pendingUpdates.add(status); } @Inject  TaskStatusHandlerImpl(
      Storage storage,
      StateManager stateManager,
      final Driver driver,
      @StatusUpdateQueue BlockingQueue<TaskStatus> pendingUpdates,
      @MaxBatchSize Integer maxBatchSize,
      CachedCounters counters); }
TaskStatusHandlerImpl extends AbstractExecutionThreadService implements TaskStatusHandler { @Override public void statusUpdate(TaskStatus status) { pendingUpdates.add(status); } @Inject  TaskStatusHandlerImpl(
      Storage storage,
      StateManager stateManager,
      final Driver driver,
      @StatusUpdateQueue BlockingQueue<TaskStatus> pendingUpdates,
      @MaxBatchSize Integer maxBatchSize,
      CachedCounters counters); @Override void statusUpdate(TaskStatus status); }
TaskStatusHandlerImpl extends AbstractExecutionThreadService implements TaskStatusHandler { @Override public void statusUpdate(TaskStatus status) { pendingUpdates.add(status); } @Inject  TaskStatusHandlerImpl(
      Storage storage,
      StateManager stateManager,
      final Driver driver,
      @StatusUpdateQueue BlockingQueue<TaskStatus> pendingUpdates,
      @MaxBatchSize Integer maxBatchSize,
      CachedCounters counters); @Override void statusUpdate(TaskStatus status);  }