@Test(timeout = TEST_TIMEOUT_MS)
public void updatesAreIgnoredWhileCooldownIsActive() {

    long cooldownPeriodMs = 5 * delayMs;
    List<Task> tasks = LoadBalancerTests.buildTasksStarted(5, jobId);
    JobLoadBalancer jobLoadBalancer = new JobLoadBalancer(jobId, loadBalancerId);
    JobLoadBalancerState association = new JobLoadBalancerState(jobLoadBalancer, State.ASSOCIATED);
    when(v3JobOperations.getTasks(jobId)).thenReturn(tasks);
    store.addOrUpdateLoadBalancer(association.getJobLoadBalancer(), association.getState()).await();
    for (Task task : tasks) {
        String ipAddress = task.getTaskContext().get(TaskAttributes.TASK_ATTRIBUTES_CONTAINER_IP);
        LoadBalancerTarget target = new LoadBalancerTarget(loadBalancerId, task.getId(), ipAddress);
        reconciler.activateCooldownFor(target, cooldownPeriodMs, TimeUnit.MILLISECONDS);
    }
    testScheduler.triggerActions();
    subscriber.assertNotCompleted().assertNoValues();
    // no updates while cooldown is active in the first iteration
    awaitReconciliationRuns(1);
    subscriber.assertNotCompleted().assertNoValues();
    awaitReconciliationRuns(4);
    subscriber.assertNotCompleted().assertValueCount(5);
    subscriber.getOnNextEvents().forEach(update -> {
        assertThat(update.getState()).isEqualTo(LoadBalancerTarget.State.REGISTERED);
        assertThat(update.getPriority()).isEqualTo(Priority.LOW);
        assertThat(update.getLoadBalancerId()).isEqualTo(loadBalancerId);
    });
    // try again since it still can't see updates applied on the connector
    awaitReconciliationRuns(1);
    subscriber.assertNotCompleted().assertValueCount(10);
}