@Test public void testRemoteSparkCancel() { RemoteSparkJobStatus jobSts = mock(RemoteSparkJobStatus.class); when(jobSts.getRemoteJobState()).thenReturn(State.CANCELLED); when(jobSts.isRemoteActive()).thenReturn(true); HiveConf hiveConf = new HiveConf(); SessionState.start(hiveConf); RemoteSparkJobMonitor remoteSparkJobMonitor = new RemoteSparkJobMonitor(hiveConf, jobSts); Assert.assertEquals(remoteSparkJobMonitor.startMonitor(), 3); }
} else if (sparkJobState == null) { Preconditions.checkState(sparkJobStatus.isRemoteActive(), "Remote context becomes inactive.");
try { state = sparkJobStatus.getRemoteJobState(); Preconditions.checkState(sparkJobStatus.isRemoteActive(), "Connection to remote Spark driver was lost");