Skip to content

Commit

Permalink
[TEST] Use correct StreamInput version to deserialize in testSnapshot…
Browse files Browse the repository at this point in the history
…DeletionsInProgressSerialization

The test is currently serializing the cluster state using an older ES version format, but then deserializes those same bytes by
assuming they are of the current ES version.
  • Loading branch information
ywelsch committed Jul 10, 2017
1 parent e85871c commit b552187
Showing 1 changed file with 1 addition and 0 deletions.
Expand Up @@ -142,6 +142,7 @@ public void testSnapshotDeletionsInProgressSerialization() throws Exception {
outStream.setVersion(Version.CURRENT.minimumIndexCompatibilityVersion());
diffs.writeTo(outStream);
inStream = outStream.bytes().streamInput();
inStream.setVersion(outStream.getVersion());
inStream = new NamedWriteableAwareStreamInput(inStream, new NamedWriteableRegistry(ClusterModule.getNamedWriteables()));
serializedDiffs = ClusterState.readDiffFrom(inStream, clusterState.nodes().getLocalNode());
stateAfterDiffs = serializedDiffs.apply(ClusterState.EMPTY_STATE);
Expand Down

0 comments on commit b552187

Please sign in to comment.