Class DumpStackTracesTimer
- java.lang.Object
-
- java.util.TimerTask
-
- org.eclipse.tycho.surefire.osgibooter.DumpStackTracesTimer
-
- All Implemented Interfaces:
java.lang.Runnable
public class DumpStackTracesTimer extends java.util.TimerTaskStarts a task which will dump stack trace information after some time. Mostly a copy of org.eclipse.test.EclipseTestRunner.startStackDumpTimeoutTimer(). Necessary to know whether and where tests are hanging if a timeout occurred during tests.
-
-
Field Summary
Fields Modifier and Type Field Description private static intSECONDS_BEFORE_TIMEOUT_BUFFERSECONDS_BEFORE_TIMEOUT_BUFFER is the time we allow ourselves to take stack traces delay "SECONDS_BETWEEN_DUMPS", then do it again.private static intSECONDS_BETWEEN_DUMPSSECONDS_BETWEEN_DUMPS is the time we wait from first to second dump of stack trace.private java.lang.StringtimeoutArg
-
Constructor Summary
Constructors Modifier Constructor Description privateDumpStackTracesTimer(java.lang.String timeoutArg)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voiddump(int num)private voiddumpStackTraces(int num, java.io.PrintStream out)private static voidlog(org.eclipse.core.runtime.IStatus warningStatus)private static voidlogError(java.lang.String message, java.lang.Exception exception)private static voidlogInfo(java.lang.String message)private voidlogStackTraces(int num)private static voidlogWarning(java.lang.String message)voidrun()(package private) static voidstartStackDumpTimeoutTimer(java.lang.String timeoutArg)Starts a timer that dumps interesting debugging information shortly before the given timeout expires.
-
-
-
Field Detail
-
SECONDS_BEFORE_TIMEOUT_BUFFER
private static final int SECONDS_BEFORE_TIMEOUT_BUFFER
SECONDS_BEFORE_TIMEOUT_BUFFER is the time we allow ourselves to take stack traces delay "SECONDS_BETWEEN_DUMPS", then do it again. On current build machine, it takes about 30 seconds to do all that, so 2 minutes should be sufficient time allowed for most machines. Though, should increase, say, if we increase the "time between dumps" to a minute or more.- See Also:
- Constant Field Values
-
SECONDS_BETWEEN_DUMPS
private static final int SECONDS_BETWEEN_DUMPS
SECONDS_BETWEEN_DUMPS is the time we wait from first to second dump of stack trace. In most cases, this should suffice to determine if still busy doing something, or, hung, or waiting for user input.- See Also:
- Constant Field Values
-
timeoutArg
private final java.lang.String timeoutArg
-
-
Method Detail
-
startStackDumpTimeoutTimer
static void startStackDumpTimeoutTimer(java.lang.String timeoutArg)
Starts a timer that dumps interesting debugging information shortly before the given timeout expires.- Parameters:
timeoutArg- the -timeout argument from the command line
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable- Specified by:
runin classjava.util.TimerTask
-
dump
private void dump(int num)
-
logStackTraces
private void logStackTraces(int num)
-
dumpStackTraces
private void dumpStackTraces(int num, java.io.PrintStream out)
-
logInfo
private static void logInfo(java.lang.String message)
-
logWarning
private static void logWarning(java.lang.String message)
-
logError
private static void logError(java.lang.String message, java.lang.Exception exception)
-
log
private static void log(org.eclipse.core.runtime.IStatus warningStatus)
-
-