# Gradle hangs during test execution

**URL:** <https://discuss.gradle.org/t/gradle-hangs-during-test-execution/1998>\
**Category:** Old Forum Archive\
**Created:** [May 3, 2012, 12:33pm UTC](https://discuss.gradle.org/t/gradle-hangs-during-test-execution/1998 "2012-05-03T12:33:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergey](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Sergey](https://discuss.gradle.org/u/Sergey)\
**Post date:** [May 3, 2012, 12:33pm UTC](https://discuss.gradle.org/t/gradle-hangs-during-test-execution/1998/1 "2012-05-03T12:33:00Z")

</div>

Gradle tests execution hangs on my machine. All tests pass on milestone 6 and 7, but from 8a and upward it hangs in the middle of execution. I think it always hang on the same test.

I am running it on Windows 7 32bit, Java 1.6

Please advice.

---

<div class="post-metadata">

**Author:** ![Rene](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/rene/32/8082_2.png) [@Rene](https://discuss.gradle.org/u/Rene)\
**Post date:** [May 3, 2012, 12:36pm UTC](https://discuss.gradle.org/t/gradle-hangs-during-test-execution/1998/2 "2012-05-03T12:36:00Z")

</div>

Hello Sergey, if you think it always hangs on the same test, can you give us a bit more informations about this test? Or even better, can you provide a selfcontained little example of the problem?

regards, René

---

<div class="post-metadata">

**Author:** ![Sergey](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Sergey](https://discuss.gradle.org/u/Sergey)\
**Post date:** [May 3, 2012, 2:01pm UTC](https://discuss.gradle.org/t/gradle-hangs-during-test-execution/1998/3 "2012-05-03T14:01:00Z")

</div>

I would be happy to supply this information, but how can I locate this test? We have hundreds of them and Gradle only writes how much tests were already executed. I saw that it is always hangs on the same number, but how can I know what test is it?

---

<div class="post-metadata">

**Author:** ![Rene](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/rene/32/8082_2.png) [@Rene](https://discuss.gradle.org/u/Rene)\
**Post date:** [May 3, 2012, 2:09pm UTC](https://discuss.gradle.org/t/gradle-hangs-during-test-execution/1998/4 "2012-05-03T14:09:00Z")

</div>

You can add a testListener to print out the test which is currently executed by adding the following snippet to your script:

```gradle
test{
    beforeTest{ descr ->
        logger.warn("Starting Test ${descr.className} : ${descr.name}")
     }
}

```

---

<div class="post-metadata">

**Author:** ![Sergey](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Sergey](https://discuss.gradle.org/u/Sergey)\
**Post date:** [May 3, 2012, 3:11pm UTC](https://discuss.gradle.org/t/gradle-hangs-during-test-execution/1998/5 "2012-05-03T15:11:00Z")

</div>

Thanks. I found the names of the tests, but I’ll have to debug in order to understand where it hang.

For now I noticed that some tests are failing with RC3 version before it hangs, although all test pass with milestone 7. I’ll update later with debug results.

---

<div class="post-metadata">

**Author:** ![Sergey](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Sergey](https://discuss.gradle.org/u/Sergey)\
**Post date:** [May 8, 2012, 6:22am UTC](https://discuss.gradle.org/t/gradle-hangs-during-test-execution/1998/6 "2012-05-08T06:22:00Z")

</div>

That was bug in our code. It caused StackOverflowError, but for some reason only with more recent Gradle versions. The problem was solved. Thanks for help.
