mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0: Improve diagnostics for JUnit tests which crashed or timed out on Jenkins
This commit is contained in:
commit
eee06be567
|
|
@ -434,6 +434,11 @@ def test(command, cell) {
|
||||||
if (!cell.step.startsWith("microbench")) {
|
if (!cell.step.startsWith("microbench")) {
|
||||||
junit testResults: "test/**/TEST-*.xml,test/**/cqlshlib*.xml,test/**/nosetests*.xml", testDataPublishers: [[$class: 'StabilityTestDataPublisher']]
|
junit testResults: "test/**/TEST-*.xml,test/**/cqlshlib*.xml,test/**/nosetests*.xml", testDataPublishers: [[$class: 'StabilityTestDataPublisher']]
|
||||||
}
|
}
|
||||||
|
// check if we had Linux OOM killer active within the test container which could kill forked JUnit JVM processes
|
||||||
|
sh """
|
||||||
|
echo "docker memory/oomkiller debug:"
|
||||||
|
cat /sys/fs/cgroup/docker/memory.events || true
|
||||||
|
"""
|
||||||
sh """
|
sh """
|
||||||
find test/output -type f -name "*.xml" -print0 | xargs -0 -r -n1 -P"\$(nproc)" xz -f
|
find test/output -type f -name "*.xml" -print0 | xargs -0 -r -n1 -P"\$(nproc)" xz -f
|
||||||
echo "test result files compressed"; find test/output -type f -name "*.xml.xz" | wc -l
|
echo "test result files compressed"; find test/output -type f -name "*.xml.xz" | wc -l
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ package org.apache.cassandra;
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.lang.reflect.Field;
|
|
||||||
|
|
||||||
import org.apache.tools.ant.BuildException;
|
import org.apache.tools.ant.BuildException;
|
||||||
import org.apache.tools.ant.taskdefs.ExecuteWatchdog;
|
import org.apache.tools.ant.taskdefs.ExecuteWatchdog;
|
||||||
|
|
@ -77,6 +76,7 @@ public class JStackJUnitTask extends JUnitTask
|
||||||
ProcessBuilder pb = new ProcessBuilder("jstack","-l", String.valueOf(pid));
|
ProcessBuilder pb = new ProcessBuilder("jstack","-l", String.valueOf(pid));
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
pb.redirectErrorStream(true);
|
||||||
Process p = pb.start();
|
Process p = pb.start();
|
||||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream())))
|
try (BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream())))
|
||||||
{
|
{
|
||||||
|
|
@ -100,22 +100,15 @@ public class JStackJUnitTask extends JUnitTask
|
||||||
|
|
||||||
private long getPid(Process process)
|
private long getPid(Process process)
|
||||||
{
|
{
|
||||||
if (process.getClass().getName().equals("java.lang.UNIXProcess"))
|
try
|
||||||
{
|
{
|
||||||
try
|
return process.pid();
|
||||||
{
|
}
|
||||||
Field f = process.getClass().getDeclaredField("pid");
|
catch (UnsupportedOperationException e)
|
||||||
f.setAccessible(true);
|
{
|
||||||
long pid = f.getLong(process);
|
System.err.println("Could not get PID");
|
||||||
f.setAccessible(false);
|
return -1;
|
||||||
return pid;
|
|
||||||
}
|
|
||||||
catch (IllegalAccessException | NoSuchFieldException e)
|
|
||||||
{
|
|
||||||
System.err.println("Could not get PID");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue