Skip to content

Commit 55b916a

Browse files
authored
Ensure task metadata not null in follow test (elastic#37993)
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.
1 parent 0470ee1 commit 55b916a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/IndexFollowingIT.java

+1
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,7 @@ private CheckedRunnable<Exception> assertTask(final int numberOfPrimaryShards, f
983983
return () -> {
984984
final ClusterState clusterState = followerClient().admin().cluster().prepareState().get().getState();
985985
final PersistentTasksCustomMetaData taskMetadata = clusterState.getMetaData().custom(PersistentTasksCustomMetaData.TYPE);
986+
assertNotNull(taskMetadata);
986987

987988
ListTasksRequest listTasksRequest = new ListTasksRequest();
988989
listTasksRequest.setDetailed(true);

0 commit comments

Comments
 (0)