Skip to content

Commit

Permalink
Ensure task metadata not null in follow test (#37993)
Browse files Browse the repository at this point in the history
This commit fixes a potential race in the IndexFollowingIT. Currently it
is possible that we fetch the task metadata, it is null, and that throws
a null pointer exception. Assertbusy does not catch null pointer
exceptions. This commit assertions that the metadata is not null.
  • Loading branch information
Tim-Brooks authored Jan 29, 2019
1 parent 0470ee1 commit 55b916a
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,7 @@ private CheckedRunnable<Exception> assertTask(final int numberOfPrimaryShards, f
return () -> {
final ClusterState clusterState = followerClient().admin().cluster().prepareState().get().getState();
final PersistentTasksCustomMetaData taskMetadata = clusterState.getMetaData().custom(PersistentTasksCustomMetaData.TYPE);
assertNotNull(taskMetadata);

ListTasksRequest listTasksRequest = new ListTasksRequest();
listTasksRequest.setDetailed(true);
Expand Down

0 comments on commit 55b916a

Please sign in to comment.