Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gretty does not shutdown Jetty process after abnormally terminating #31

Open
wcrowell opened this issue Jun 27, 2016 · 3 comments
Open

Comments

@wcrowell
Copy link

If Gretty abnormally terminates, then the container (Jetty) does not stop. This may be a bug in Gretty [https://github.com/akhikhl/issues/214] or Gradle [https://issues.gradle.org/browse/GRADLE-2263] which will be released in Gradle 3.0.

Workaround: This empty AppStopTask task makes Jetty shutdown if any of the tests fail.

task ('shutdownHook', type: AppStopTask) << { } project.afterEvaluate { project.tasks.test.finalizedBy shutdownHook }
afterEvaluate makes sure the empty shutdownHook task runs when the test task exits from execution.

@saladinkzn
Copy link
Owner

Hello, I'll try to reproduce this.

@wcrowell
Copy link
Author

If you clone the following project: https://github.com/wcrowell/cas-functional-tests

Comment out lines 53 and 54 as well as 58-60. Open up src/test/groovy/ValidateSpec.groovy. On line 12 change the call to getServiceTicket to some non-existent function:

def serviceTicket = getServiceTicket2("protected-web-app")

Run the tests again: gradle clean farmIntegrationTest

You should get an error like:

ValidateSpec > CAS 1.0 validation FAILED groovy.lang.MissingMethodException at ValidateSpec.groovy:12

Run ps -ef | grep jetty

You should see a jetty process running.

I am uncertain if any time should be spent on this since I think it is an issue with Gradle https://issues.gradle.org/browse/GRADLE-2263

@saladinkzn
Copy link
Owner

well, as far as I can remember gretty doesn't use jetty plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants