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.
This commit is contained in:
Tim Brooks 2019-01-29 15:58:31 -07:00 committed by GitHub
parent 0470ee1fcc
commit 55b916afc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -983,6 +983,7 @@ public class IndexFollowingIT extends CcrIntegTestCase {
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);