use of com.netflix.eureka.util.batcher.TaskProcessor.ProcessingResult in project eureka by Netflix.
the class ReplicationTaskProcessorTest method testNonBatchableTaskExecution.
@Test
public void testNonBatchableTaskExecution() throws Exception {
TestableInstanceReplicationTask task = aReplicationTask().withAction(Action.Heartbeat).withReplyStatusCode(200).build();
ProcessingResult status = replicationTaskProcessor.process(task);
assertThat(status, is(ProcessingResult.Success));
}
use of com.netflix.eureka.util.batcher.TaskProcessor.ProcessingResult in project eureka by Netflix.
the class RecordingProcessor method expectTransientErrors.
public void expectTransientErrors(int count) throws InterruptedException {
for (int i = 0; i < count; i++) {
ProcessingResult task = transientErrorTasks.poll(5, TimeUnit.SECONDS);
assertThat(task, is(notNullValue()));
}
}
use of com.netflix.eureka.util.batcher.TaskProcessor.ProcessingResult in project eureka by Netflix.
the class RecordingProcessor method expectSuccesses.
public void expectSuccesses(int count) throws InterruptedException {
for (int i = 0; i < count; i++) {
ProcessingResult task = completedTasks.poll(5, TimeUnit.SECONDS);
assertThat(task, is(notNullValue()));
}
}
use of com.netflix.eureka.util.batcher.TaskProcessor.ProcessingResult in project eureka by Netflix.
the class TaskDispatchersTest method testSingleTaskDispatcher.
@Test
public void testSingleTaskDispatcher() throws Exception {
dispatcher = TaskDispatchers.createNonBatchingTaskDispatcher("TEST", MAX_BUFFER_SIZE, 1, MAX_BATCHING_DELAY_MS, SERVER_UNAVAILABLE_SLEEP_TIME_MS, RETRY_SLEEP_TIME_MS, processor);
dispatcher.process(1, ProcessingResult.Success, System.currentTimeMillis() + 60 * 1000);
ProcessingResult result = processor.completedTasks.poll(5, TimeUnit.SECONDS);
assertThat(result, is(equalTo(ProcessingResult.Success)));
}
use of com.netflix.eureka.util.batcher.TaskProcessor.ProcessingResult in project eureka by Netflix.
the class ReplicationTaskProcessorTest method testNonBatchableTaskCongestionFailureHandling.
@Test
public void testNonBatchableTaskCongestionFailureHandling() throws Exception {
TestableInstanceReplicationTask task = aReplicationTask().withAction(Action.Heartbeat).withReplyStatusCode(503).build();
ProcessingResult status = replicationTaskProcessor.process(task);
assertThat(status, is(ProcessingResult.Congestion));
assertThat(task.getProcessingState(), is(ProcessingState.Pending));
}
Aggregations