@Test public void testProcessInfo() throws Exception { LOG.info("Process info of JobTracker is : " + cluster.getJTClient().getProcessInfo()); Assert.assertNotNull(cluster.getJTClient().getProcessInfo()); Collection<TTClient> tts = cluster.getTTClients(); for (TTClient tt : tts) { LOG.info("Process info of TaskTracker is : " + tt.getProcessInfo()); Assert.assertNotNull(tt.getProcessInfo()); } }
@BeforeClass public static void before() throws Exception { String[] excludeExpList = {"java.net.ConnectException", "java.io.IOException"}; cluster = MRCluster.createCluster(conf); cluster.setExcludeExpList(excludeExpList); cluster.setUp(); cSize = cluster.getTTClients().size(); jtClient = cluster.getJTClient(); rtClient = jtClient.getProxy(); gridmixDir = new Path("herriot-gridmix"); UtilsForGridmix.createDirs(gridmixDir, rtClient.getDaemonConf()); }
@Test public void testClusterRestart() throws Exception { cluster.stop(); // Give the cluster time to stop the whole cluster. AbstractDaemonClient cli = cluster.getJTClient(); int i = 1; while (i < 40) { try { cli.ping(); Thread.sleep(1000); i++; } catch (Exception e) { break; } } if (i >= 40) { Assert.fail("JT on " + cli.getHostName() + " Should have been down."); } i = 1; for (AbstractDaemonClient tcli : cluster.getTTClients()) { i = 1; while (i < 40) { try { tcli.ping(); Thread.sleep(1000); i++; } catch (Exception e) { break; } } if (i >= 40) { Assert.fail("TT on " + tcli.getHostName() + " Should have been down."); } } cluster.start(); cli = cluster.getJTClient(); i = 1; while (i < 40) { try { cli.ping(); break; } catch (Exception e) { i++; Thread.sleep(1000); LOG.info("Waiting for Jobtracker on host : " + cli.getHostName() + " to come up."); } } if (i >= 40) { Assert.fail("JT on " + cli.getHostName() + " Should have been up."); } for (AbstractDaemonClient tcli : cluster.getTTClients()) { i = 1; while (i < 40) { try { tcli.ping(); break; } catch (Exception e) { i++; Thread.sleep(1000); LOG.info("Waiting for Tasktracker on host : " + tcli.getHostName() + " to come up."); } } if (i >= 40) { Assert.fail("TT on " + tcli.getHostName() + " Should have been Up."); } } }