// Increase number of instances
controller.changeInstances("EchoServer", 3);
Assert.assertTrue(YarnTestUtils.waitForSize(echoServices, 3, 60));
echoServices = controller.discoverService("echo2");
// Decrease number of instances
controller.changeInstances("EchoServer", 1);
Assert.assertTrue(YarnTestUtils.waitForSize(echoServices, 1, 60));