[GRADLE-2170] Builds hangs while running tests put restrictive security manager policy in place Created: 14/Mar/12  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Won't Fix Votes: 7

Issue Links:
Duplicates GRADLE-903 Test task does not handle the case wh... Resolved
Duplicated by GRADLE-2169 CountDownLatch not released while run... Resolved


The Groovy project is (slowly) migrating to Gradle for its build. However, we encounter a problem with a test suite which makes Gradle hang after running a bunch of tests. The problem is described here: [1]http://gradle.1045684.n5.nabble.com/I...

A JIRA issue has been created for this: GRADLE-2169
[1] http://gradle.1045684.n5.nabble.com/Infinite-wait-running-tests-tp5561210p5561210.html

Comment by Strong Liu [ 20/Mar/12 ]

I also run into this issue when running hibernate testsuite

Comment by Steve Ebersole [ 20/Mar/12 ]

To be clear... Strong runs into the same symptom: builds hanging during test execution. Hibernate build is not swapping security managers during tests.

Comment by Richard Bair [ 05/Feb/13 ]

I'm seeing the same issue with OpenJFX. I have a unit test which installs a security manager, and this causes gradle to hang while executing tests.


Comment by Adrian Kelly (Inactive) [ 04/Feb/16 ]

Reproduced with a test: https://github.com/gradle/gradle/commit/8be958eeb418b4107053d76a55e0dd022288cdbf

Comment by Dominik Stadler [ 19/Apr/16 ]

I think I run into the same problem with current Gradle when I upgrade my project from Elasticsearch <= 2.1.x to >= 2.2.0. Elasticsearch added some SecurityManager functionality which kicks in during tests and this also seems to cause hanging test-execution in Gradle as described here.

An Elasticsearch-related workaround for this seems to be:

test {
    systemProperties = System.properties

    // see https://github.com/elastic/elasticsearch/issues/16459
    // and also https://issues.gradle.org/browse/GRADLE-2170
    systemProperty 'tests.security.manager', 'false'
Comment by Nik Everett [ 06/May/16 ]

That particular workaround for Elasticsearch is only going to last another few months I think. I believe the security manager will be non-optional in the next major release of Elasticsearch.

That very same release Elasticsearch switched to gradle as its build system. I suspect the reason this works for Elasticsearch is because it doesn't use the builtin support for running tests and instead uses the stuff in here which it has so that it can use Carrot search's Randomized Testing. I can't speculate why that works and the builtin doesn't.

I don't know if that helps anyone.

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 10/Feb/17 ]

Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved.

Generated at Wed Jun 30 12:14:36 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.