Search in sources :

Example 1 with KubernetesTooOldResourceVersionException

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));
            });
        }
    };
}
Also used : KubernetesTooOldResourceVersionException(org.apache.flink.kubernetes.kubeclient.resources.KubernetesTooOldResourceVersionException) ExpectedTestException(org.apache.flink.runtime.operators.testutils.ExpectedTestException) KubernetesTooOldResourceVersionException(org.apache.flink.kubernetes.kubeclient.resources.KubernetesTooOldResourceVersionException) Test(org.junit.Test)

Aggregations

KubernetesTooOldResourceVersionException (org.apache.flink.kubernetes.kubeclient.resources.KubernetesTooOldResourceVersionException)1 ExpectedTestException (org.apache.flink.runtime.operators.testutils.ExpectedTestException)1 Test (org.junit.Test)1