Skip to content

Commit

Permalink
TEZ-4364: TestFaultTolerance timeout on master
Browse files Browse the repository at this point in the history
  • Loading branch information
abstractdog committed Dec 27, 2021
1 parent c9b8e90 commit 5929c6b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.tez.runtime.api.Event;

import com.google.common.annotations.VisibleForTesting;

import java.util.Objects;

/**
Expand Down Expand Up @@ -79,11 +81,14 @@ private InputReadErrorEvent(final String diagnostics, final int index, final int
this.destinationLocalhostName = destinationLocalhostName;
}

public static InputReadErrorEvent create(String diagnostics, int index, int version,
boolean isLocalFetch, boolean isDiskErrorAtSource) {
return create(diagnostics, index, version, 1, isLocalFetch, isDiskErrorAtSource, null);
}

/**
* Creates an InputReadErrorEvent from less parameters, supposed to be used from tests only.
* @param diagnostics
* @param index
* @param version
* @return InputReadErrorEvent instance
*/
@VisibleForTesting
public static InputReadErrorEvent create(String diagnostics, int index, int version) {
return create(diagnostics, index, version, 1, false, false, null);
}
Expand Down
7 changes: 4 additions & 3 deletions tez-tests/src/test/java/org/apache/tez/test/TestInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public int doRead() {
for (int i=0; i<getNumPhysicalInputs(); ++i) {
String msg = ("FailingInput: " + getContext().getUniqueIdentifier() +
" index: " + i + " version: " + lastInputReadyValue);
events.add(InputReadErrorEvent.create(msg, i, lastInputReadyValue));
events.add(InputReadErrorEvent.create(msg, i, lastInputReadyValue, 1, false, false, "localhost"));
LOG.info("Failing input: " + msg);
}
} else {
Expand All @@ -189,7 +189,8 @@ public int doRead() {
}
String msg = ("FailingInput: " + getContext().getUniqueIdentifier() +
" index: " + index.intValue() + " version: " + lastInputReadyValue);
events.add(InputReadErrorEvent.create(msg, index.intValue(), lastInputReadyValue));
events.add(InputReadErrorEvent.create(msg, index.intValue(), lastInputReadyValue, 1, false, false,
"localhost"));
LOG.info("Failing input: " + msg);
}
}
Expand Down Expand Up @@ -263,7 +264,7 @@ public int doRead() {
getContext().getUniqueIdentifier() +
" index: " + index + " version: " + sourceInputVersion;
LOG.info(msg);
events.add(InputReadErrorEvent.create(msg, index, sourceInputVersion));
events.add(InputReadErrorEvent.create(msg, index, sourceInputVersion, 1, false, false, "localhost"));
}
}
}
Expand Down

0 comments on commit 5929c6b

Please sign in to comment.