// Decrease number of instances
controller.changeInstances("EchoServer", 1);
Assert.assertTrue(YarnTestUtils.waitForSize(echoServices, 1, 60));
// Increase number of instances again
controller.changeInstances("EchoServer", 2);
Assert.assertTrue(YarnTestUtils.waitForSize(echoServices, 2, 60));
// Make sure still only one app is running
Iterable<TwillRunner.LiveInfo> apps = runner.lookupLive();
Assert.assertTrue(YarnTestUtils.waitForSize(apps, 1, 60));