Class JstackTimeoutExtension
java.lang.Object
org.apache.maven.plugin.surefire.extensions.timeout.JstackTimeoutExtension
- All Implemented Interfaces:
ForkedProcessTimeoutExtension
Built-in
ForkedProcessTimeoutExtension that captures a jstack
thread dump of the forked test JVM just before it is killed because of
forkedProcessTimeoutInSeconds.
The output is written to
<reportsDirectory>/surefire-timeout-jstack-<forkNumber>-<pid>.txt.
Activation: this extension is registered via
META-INF/services but is disabled by default. To enable it
set the system property surefire.timeout.jstack.enabled=true on the
Maven process (for example with MAVEN_OPTS or
-Dsurefire.timeout.jstack.enabled=true). The jstack binary
is resolved from ${java.home}/bin/jstack, the parent JDK bin
(Java 8 layout), $JAVA_HOME/bin/jstack, and finally from PATH.
- Since:
- 3.6.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringExtension-context key that enables this extension from the POM via theforkedProcessTimeoutExtensionContextMojo parameter.static final StringSystem property that enables this extension.static final StringExtension context key that overrides the directory where thesurefire-timeout-jstack-*.txtfiles are written. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonForkExited(ForkedProcessTimeoutContext context, RunResult runResult) void
-
Field Details
-
ENABLED_PROPERTY
System property that enables this extension.- See Also:
-
ENABLED_KEY
Extension-context key that enables this extension from the POM via theforkedProcessTimeoutExtensionContextMojo parameter. Set totrueto enable. When either this key orENABLED_PROPERTYis set totrue, the extension runs.- See Also:
-
OUTPUT_LOCATION_KEY
Extension context key that overrides the directory where thesurefire-timeout-jstack-*.txtfiles are written. When the key is missing or blank, the Surefire reports directory is used.- See Also:
-
-
Constructor Details
-
JstackTimeoutExtension
public JstackTimeoutExtension()
-
-
Method Details
-
onTimeoutDetected
- Specified by:
onTimeoutDetectedin interfaceForkedProcessTimeoutExtension
-
onForkExited
- Specified by:
onForkExitedin interfaceForkedProcessTimeoutExtension
-