maheshrajus commented on code in PR #520:
URL: https://github.com/apache/tez/pull/520#discussion_r3659611527
##########
tez-tests/src/test/java/org/apache/tez/test/TestAMRecoveryAggregationBroadcast.java:
##########
@@ -356,14 +374,40 @@ TezCounters runDAGAndVerify(DAG dag, boolean killAM)
throws Exception {
LOG.info("Diagnosis: " + dagStatus.getDiagnostics());
assertEquals(State.SUCCEEDED, dagStatus.getState());
- FSDataInputStream in = remoteFs.open(new Path(OUT_PATH,
"part-v002-o000-r-00000"));
+ FSDataInputStream in = remoteFs.open(new Path(outPath,
"part-v002-o000-r-00000"));
ByteBuffer buf = ByteBuffer.allocate(100);
in.read(buf);
buf.flip();
assertEquals(EXPECTED_OUTPUT,
StandardCharsets.UTF_8.decode(buf).toString());
return dagStatus.getDAGCounters();
}
+ private void waitForVertexSucceeded(DAGClient dagClient, String vertexName,
+ long timeoutMs) throws Exception {
+ long deadline = System.currentTimeMillis() + timeoutMs;
+ while (System.currentTimeMillis() < deadline) {
+ // Before the vertex is initialized on the AM, getVertexStatus may
+ // return null - treat that the same as NEW / INITIALIZING and keep
+ // polling.
+ VertexStatus status = dagClient.getVertexStatus(vertexName, null);
+ if (status != null) {
+ VertexStatus.State state = status.getState();
+ if (state == VertexStatus.State.SUCCEEDED) {
+ return;
+ }
+ if (state == VertexStatus.State.FAILED
+ || state == VertexStatus.State.KILLED
+ || state == VertexStatus.State.ERROR) {
+ throw new AssertionError("Vertex " + vertexName
+ + " reached terminal non-success state: " + state);
+ }
+ }
Review Comment:
Fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]