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

TEZ-4475: VertexStatus is missing in TestLocalMode if DAG finishes too early - causing NPE in unit test #267

Merged
merged 2 commits into from
Feb 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions tez-tests/src/test/java/org/apache/tez/test/TestLocalMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@
@RunWith(Parameterized.class)
public class TestLocalMode {

/**
* In order to be able to safely get VertexStatus from a running DAG,
* the DAG needs to run for a certain amount of time, see TEZ-4475
*/
private static final int SLEEP_PROCESSOR_TIME_TO_SLEEP_MS = 500;

private static final File STAGING_DIR = new File(System.getProperty("test.build.data"),
TestLocalMode.class.getName());

Expand Down Expand Up @@ -255,8 +261,9 @@ public void run(Map<String, LogicalInput> inputs, Map<String, LogicalOutput> out
}

private DAG createSimpleDAG(String dagName, String processorName) {
DAG dag = DAG.create(dagName).addVertex(Vertex.create(SleepProcessor.SLEEP_VERTEX_NAME, ProcessorDescriptor
.create(processorName).setUserPayload(new SleepProcessor.SleepProcessorConfig(1).toUserPayload()), 1));
DAG dag = DAG.create(dagName).addVertex(
Vertex.create(SleepProcessor.SLEEP_VERTEX_NAME, ProcessorDescriptor.create(processorName).setUserPayload(
new SleepProcessor.SleepProcessorConfig(SLEEP_PROCESSOR_TIME_TO_SLEEP_MS).toUserPayload()), 1));
return dag;
}

Expand Down