Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,15 @@ public void verify_jvm_agent_with_options() throws Exception {
public void verify_jvm_agent_multiple_agents() throws Exception {
super.verify_jvm_agent_multiple_agents();
}
@Test
@Override
public void verify_exit_code_is_printed_to_logs() throws Exception {
super.verify_exit_code_is_printed_to_logs();
}

@Test
@Override
public void verify_exit_code_is_reported() {
super.verify_exit_code_is_reported();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,10 @@ public void verify_jvm_agent_multiple_agents() throws Exception {
public void verify_exit_code_is_reported() {
super.verify_exit_code_is_reported();
}

@Test
@Override
public void verify_exit_code_is_printed_to_logs() throws Exception {
super.verify_exit_code_is_printed_to_logs();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ public void verify_jvm_agent_multiple_agents() throws Exception {
super.verify_jvm_agent_multiple_agents();
}

@Test
@Override
public void verify_exit_code_is_printed_to_logs() throws Exception {
super.verify_exit_code_is_printed_to_logs();
}

@Test
@Override
public void verify_exit_code_is_reported() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ public void verify_slave_working_dir() throws IOException {
super.verify_slave_working_dir();
}

@Test
@Override
public void verify_exit_code_is_printed_to_logs() throws Exception {
super.verify_exit_code_is_printed_to_logs();
}

@Test
public void verify_jvm_agent() throws Exception {
super.verify_jvm_agent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,31 @@ public Void call() throws Exception {
});
}

public void verify_exit_code_is_printed_to_logs() throws Exception {
ViNode node = cloud.node(testName.getMethodName());
StringWriter writer = new StringWriter();
node.x(VX.CONSOLE).bindOut(writer);
node.exec(new Runnable() {
@Override
public void run() {
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.exit(42);
}
}).start();
}
});

Thread.sleep(2000);
assertThat(writer.toString()).contains("Process exited with code 42");
}

public void verify_exit_code_is_reported() {
ViNode node = cloud.node(testName.getMethodName());

Expand Down Expand Up @@ -736,7 +761,7 @@ public void run() {
assertThat(writer.toString()).contains("Terminated, exitCode=42");
}
}

private static String readMarkerFromResources() throws IOException {
URL url = IsolateNodeFeatureTest.class.getResource("/marker.txt");
Assert.assertNotNull(url);
Expand Down
Loading