Skip to content

Commit 5b264a9

Browse files
committed
Ensure task metadata not null in follow test (#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 d62eee7 commit 5b264a9

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,7 @@ private CheckedRunnable<Exception> assertTask(final int numberOfPrimaryShards, f
841841
return () -> {
842842
final ClusterState clusterState = followerClient().admin().cluster().prepareState().get().getState();
843843
final PersistentTasksCustomMetaData taskMetadata = clusterState.getMetaData().custom(PersistentTasksCustomMetaData.TYPE);
844+
assertNotNull(taskMetadata);
844845

845846
ListTasksRequest listTasksRequest = new ListTasksRequest();
846847
listTasksRequest.setDetailed(true);

0 commit comments

Comments
 (0)