# Dump stack trace for tests

**URL:** <https://discuss.gradle.org/t/dump-stack-trace-for-tests/33524>\
**Category:** Help/Discuss\
**Created:** [October 14, 2019, 8:12pm UTC](https://discuss.gradle.org/t/dump-stack-trace-for-tests/33524 "2019-10-14T20:12:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![deanhiller](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/deanhiller/32/5516_2.png) [@deanhiller](https://discuss.gradle.org/u/deanhiller)\
**Post date:** [October 14, 2019, 8:12pm UTC](https://discuss.gradle.org/t/dump-stack-trace-for-tests/33524/1 "2019-10-14T20:12:42Z")

</div>

Is there a way to dump stack trace of VM in certain tests? My tests only fail when ‘all’ run at once so I need to run them all and dump 1 test’s stack trace after it starts 20 seconds in or so to see what is going on. Is there a way to do this?

or just auto stack dump any test that takes over 20 seconds would be sick!!! does that exist?

thanks,  
Dean

---

<div class="post-metadata">

**Author:** ![Stefan\_Wolf](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/stefan_wolf/32/5519_2.png) [@Stefan\_Wolf](https://discuss.gradle.org/u/Stefan_Wolf)\
**Post date:** [November 4, 2019, 4:24pm UTC](https://discuss.gradle.org/t/dump-stack-trace-for-tests/33524/2 "2019-11-04T16:24:43Z")

</div>

The Gradle build uses something for its integration tests: [https://github.com/gradle/gradle/blob/903c5f2cee88c9768077d46025eaafdf65862fc8/buildSrc/subprojects/integration-testing/src/main/kotlin/org/gradle/gradlebuild/test/integrationtests/IntegrationTest.kt#L39-L76](https://github.com/gradle/gradle/blob/903c5f2cee88c9768077d46025eaafdf65862fc8/buildSrc/subprojects/integration-testing/src/main/kotlin/org/gradle/gradlebuild/test/integrationtests/IntegrationTest.kt#L39-L76)

So if an integration test task takes more than a certain amount of time, the stack traces are printed to the console log. This allows us to analyze hanging tests.
