Open reta opened 2 weeks ago
@gargharsh3134 could you please take a look? caused by #14641 / #16455
The test creates a string array: https://github.com/opensearch-project/OpenSearch/blob/99a9a81da366173b0c2b963b26ea92e15ef34547/server/src/test/java/org/opensearch/action/admin/cluster/shards/CatShardsRequestTests.java#L96
But the elements of the array are null, and thus fail when attempting to serialize for transport.
The failure didn't occur on 3.0.0 or 2.8.0 because the previous version didn't pass the "on or after" check and never attempted to serialize the array of nulls. It's failing on 2.8.1 because the previous version is 2.8.0 and does meet the earlier version on or after 2.8.0, and reads the string array.
Fix is probably populating that string array with some random strings, similar to how is done in another test in the same class: https://github.com/opensearch-project/OpenSearch/blob/99a9a81da366173b0c2b963b26ea92e15ef34547/server/src/test/java/org/opensearch/action/admin/cluster/shards/CatShardsRequestTests.java#L42-L45
Describe the bug
The test case
org.opensearch.action.admin.cluster.shards.CatShardsRequestTests.testSerializationWithOlderVersionsParametersNotSerialized
fails with NPE:Related component
Other
To Reproduce
Pull
https://github.com/opensearch-project/OpenSearch/pull/16571
and run./gradlew ':server:test' --tests "org.opensearch.action.admin.cluster.shards.CatShardsRequestTests.testSerializationWithOlderVersionsParametersNotSerialized"
Expected behavior
The test case should pass
Additional Details
Plugins Please list all plugins currently enabled.
Screenshots If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
Additional context Add any other context about the problem here.