Fix CompressibleBytesOutputStreamTests (#60815) (#60822)

Since #60730 the `bytes` field can be `null`. This adds the missing `null` check to the test
override.

Closes #60814
This commit is contained in:
Armin Braun 2020-08-06 15:07:48 +02:00 committed by GitHub
parent bc17afc535
commit a2c7991e96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -31,7 +31,6 @@ import java.io.IOException;
public class CompressibleBytesOutputStreamTests extends ESTestCase {
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/60814")
public void testStreamWithoutCompression() throws IOException {
BytesStream bStream = new ZeroOutOnCloseStream();
CompressibleBytesOutputStream stream = new CompressibleBytesOutputStream(bStream, false);
@ -115,8 +114,10 @@ public class CompressibleBytesOutputStreamTests extends ESTestCase {
@Override
public void close() {
if (bytes != null) {
int size = (int) bytes.size();
bytes.set(0, new byte[size], 0, size);
}
}
}
}