ChannelShell shell = s.createShellChannel();
ByteArrayOutputStream out = new ByteArrayOutputStream();
ByteArrayOutputStream err = new ByteArrayOutputStream();
shell.setOut(out);
shell.setErr(err);
shell.open().await();
int res = s.waitFor(ClientSession.CLOSED, 5000);
assertTrue((res & ClientSession.CLOSED) != 0);
assertTrue(latch.await(1, TimeUnit.SECONDS));
assertTrue(TestEchoShellFactory.TestEchoShell.latch.await(1, TimeUnit.SECONDS));
}