/** * FLINK-6641 * * <p>Tests that the {@link ClusterClient} does not clean up HA data when being shut down. */ @Test public void testClusterClientShutdown() throws Exception { Configuration config = new Configuration(); HighAvailabilityServices highAvailabilityServices = mock(HighAvailabilityServices.class); StandaloneClusterClient clusterClient = new StandaloneClusterClient(config, highAvailabilityServices, false); clusterClient.shutdown(); // check that the client does not clean up HA data but closes the services verify(highAvailabilityServices, never()).closeAndCleanupAllData(); verify(highAvailabilityServices).close(); }
haServices.closeAndCleanupAllData();
highAvailabilityServices.closeAndCleanupAllData();
highAvailabilityServices.closeAndCleanupAllData();
public void close() throws Exception { Exception exception = null; actorSystem.shutdown(); actorSystem.awaitTermination(); try { highAvailabilityServices.closeAndCleanupAllData(); } catch (Exception e) { exception = e; } scheduledExecutorService.shutdownNow(); try { scheduledExecutorService.awaitTermination(timeout.toMillis(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); exception = ExceptionUtils.firstOrSuppressed(e, exception); } if (exception != null) { throw exception; } } }
highAvailabilityServices.closeAndCleanupAllData(); } catch (Exception e) { exception = e;
try { if (cleanupHaData) { haServices.closeAndCleanupAllData(); } else { haServices.close();
haServices.closeAndCleanupAllData(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception);
haServices.closeAndCleanupAllData(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception);
haServices.closeAndCleanupAllData(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception);
try { if (cleanupHaData) { haServices.closeAndCleanupAllData(); } else { haServices.close();
try { if (cleanupHaData) { haServices.closeAndCleanupAllData(); } else { haServices.close();
haServices.closeAndCleanupAllData(); } catch (Exception e) { exception = firstOrSuppressed(e, exception);