use of org.apache.flink.kubernetes.kubeclient.resources.KubernetesTooOldResourceVersionException in project flink by apache.
the class KubernetesResourceManagerDriverTest method testNewWatchCreationWhenKubernetesTooOldResourceVersionException.
@Test
public void testNewWatchCreationWhenKubernetesTooOldResourceVersionException() throws Exception {
new Context() {
{
runTest(() -> {
getPodCallbackHandler().handleError(new KubernetesTooOldResourceVersionException(new Exception("too old resource version")));
// Verify the old watch is closed and a new one is created
CommonTestUtils.waitUntilCondition(() -> getPodsWatches().size() == 2, Deadline.fromNow(Duration.ofSeconds(TIMEOUT_SEC)), String.format("New watch is not created in %s seconds.", TIMEOUT_SEC));
assertThat(getPodsWatches().get(0).isClosed(), is(true));
assertThat(getPodsWatches().get(1).isClosed(), is(false));
});
}
};
}
Aggregations