提交 22c7b555 编写于 作者: K kohsuke

adding logging for diagnosing the test failure on Hudson server

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@13292 71c3de6d-444a-0410-be80-ed276b4c234a
上级 f65e4c2e
...@@ -27,6 +27,8 @@ import java.util.Map.Entry; ...@@ -27,6 +27,8 @@ import java.util.Map.Entry;
import java.util.UUID; import java.util.UUID;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import static java.util.logging.Level.FINEST;
import static java.util.logging.Level.FINER;
/** /**
* Kills a process tree to clean up the mess left by a build. * Kills a process tree to clean up the mess left by a build.
...@@ -535,6 +537,8 @@ public abstract class ProcessTreeKiller { ...@@ -535,6 +537,8 @@ public abstract class ProcessTreeKiller {
try { try {
RandomAccessFile as = new RandomAccessFile(getFile("as"),"r"); RandomAccessFile as = new RandomAccessFile(getFile("as"),"r");
if(LOGGER.isLoggable(FINER))
LOGGER.finer("Reading "+getFile("as"));
try { try {
for( int n=0; ; n++ ) { for( int n=0; ; n++ ) {
// read a pointer to one entry // read a pointer to one entry
...@@ -542,13 +546,24 @@ public abstract class ProcessTreeKiller { ...@@ -542,13 +546,24 @@ public abstract class ProcessTreeKiller {
int p = as.readInt(); int p = as.readInt();
if(p==0) if(p==0)
break; // completed the walk break; // completed the walk
if(LOGGER.isLoggable(FINEST))
LOGGER.finest("Reading env["+n+"] at "+p);
// now read the null-terminated string // now read the null-terminated string
as.seek(to64(p)); as.seek(to64(p));
ByteArrayOutputStream buf = new ByteArrayOutputStream(); ByteArrayOutputStream buf = new ByteArrayOutputStream();
int ch; int ch,i=0;
while((ch=as.read())!=0) while((ch=as.read())!=0) {
if((++i)%100==0 && LOGGER.isLoggable(FINEST))
LOGGER.finest("env["+n+"] is so far "+buf.toString());
buf.write(ch); buf.write(ch);
envVars.addLine(buf.toString()); }
String line = buf.toString();
if(LOGGER.isLoggable(FINEST))
LOGGER.finest("env["+n+"] was "+line);
envVars.addLine(line);
} }
} finally { } finally {
// failed to read. this can happen under normal circumstances, // failed to read. this can happen under normal circumstances,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册