Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HADOOP-17181. Handle transient stream read failures in FileSystem contract tests #2286

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public void testPositionedBulkReadDoesntChangePosition() throws Throwable {

int v = 256;
byte[] readBuffer = new byte[v];
assertEquals(v, instream.read(128, readBuffer, 0, v));
instream.readFully(128, readBuffer, 0, v);
//have gone back
assertEquals(40000, instream.getPos());
//content is the same too
Expand Down Expand Up @@ -572,8 +572,7 @@ public void testReadSmallFile() throws Throwable {

// now read the entire file in one go
byte[] fullFile = new byte[TEST_FILE_LEN];
assertEquals(TEST_FILE_LEN,
instream.read(0, fullFile, 0, fullFile.length));
instream.readFully(0, fullFile, 0, fullFile.length);
assertEquals(0, instream.getPos());

// now read past the end of the file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ protected void validateFileContents(FSDataInputStream stream, int length,
throws IOException {
byte[] streamData = new byte[length];
assertEquals("failed to read expected number of bytes from "
+ "stream", length, stream.read(streamData));
+ "stream. This may be transient",
length, stream.read(streamData));
byte[] validateFileBytes;
if (startIndex == 0 && length == fileBytes.length) {
validateFileBytes = fileBytes;
Expand Down