ArrangeTaskExecutor extends AbstractLifecycle implements TopElement, Runnable { protected Thread getTaskThread() { return taskThread; }  void offer(ReshardingTask task); void clearTasks(); @Override int getOrder(); @Override void run(); long getTotalTasks(); void setCurrentClusterServer(CurrentClusterServer currentClusterServer); static final String ARRANGE_TASK_EXECUTOR_START; }
@Test public void testStop() throws Exception{ System.setProperty(ArrangeTaskExecutor.ARRANGE_TASK_EXECUTOR_START, "true"); arrangeTaskExecutor.initialize(); arrangeTaskExecutor.start(); sleep(50); Assert.assertTrue(arrangeTaskExecutor.getTaskThread().isAlive()); arrangeTaskExecutor.stop(); waitConditionUntilTimeOut( () -> arrangeTaskExecutor.getTaskThread() == null, 1000); }