Skip to content

Commit

Permalink
[Transform] Fix TransformRobustnessIT.testTransformLifecycleInALoop test
Browse files Browse the repository at this point in the history
  • Loading branch information
przemekwitek committed Apr 16, 2024
1 parent 2e847e8 commit df7009a
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,14 @@ public void testContinuousTransformLifecycleInALoop() throws Exception {

// Stop the transform with force set randomly.
stopTransform(transformId, force);
// After the transform is stopped, there should be no transform task left.
assertThat(getTransformTasks(), is(empty()));
if (force) {
// If the "force" has been used, then the persistent task is removed from the cluster state but the local task can still
// be seen by the PersistentTasksNodeService. We need to wait until PersistentTasksNodeService reconciles the state.
assertBusy(() -> assertThat(getTransformTasks(), is(empty())));
} else {
// If the "force" hasn't been used then we can expect the local task to be already gone.
assertThat(getTransformTasks(), is(empty()));
}
assertThat(getTransformTasksFromClusterState(transformId), is(empty()));

// Delete the transform.
Expand Down

0 comments on commit df7009a

Please sign in to comment.