clojure-expectations / lein-autoexpect

Run expecations when source or test files change
103 stars 12 forks source link

Java process left #21

Closed tsulej closed 6 years ago

tsulej commented 7 years ago

On Windows 10 I observed that after exiting autexpect some Java process is still running in background.

jakemcc commented 7 years ago

Thanks for the report. What version of autoexpect, expectations, and Clojure?

Any details on what Java process is left hanging? Any chance you could grab a stacktrace?

I'm not going to be able to try this out until I get a Windows 10 VM setup, which given my current schedule. I won't be able to do until probably next week.

tsulej commented 7 years ago

Details are as follows (from my project.clj) [org.clojure/clojure "1.9.0-beta1"] [expectations "2.2.0-rc1"] plugins: [lein-expectations "0.0.8"] [lein-autoexpect "1.9.0"]

$ java -version java version "1.8.0_112" Java(TM) SE Runtime Environment (build 1.8.0_112-b15) Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)

Full stacktrace: autoexpect_stacktrace.txt

I exit from autoexpect just by clicking "ctrl-c". lein autoexpect is run from Cygwin terminal (but I think it's not related).

In stacktrace I see some process related to java.awt events. In my test I dispatch events to created window (which is later closed). I later try to check this on empty project to exclude (or confirm) reasons on my side.

jakemcc commented 7 years ago

@tsulej Great. Thanks for the details.

tsulej commented 7 years ago

Ok, freshly made empty project has the same behaviour.

Project: expect.zip

And stacktrace: empty_project.txt

tsulej commented 7 years ago

One more information, checked behaviour of lein-test-refresh and it doesn't leave any processes.

jakemcc commented 7 years ago

Awesome, thanks for looking at this.

jakemcc commented 7 years ago

@tsulej I looked into this some today though I don't have a fix.

I've only been able to reproduce this if I'm running using Cygwin. If I'm running at the windows command prompt every process quits. It looks like like the parent Leiningen process is being killed but the child process continues living.

lein-autoexpect is in a pretty simple loop that checks for differences and then sleeps. It really doesn't do much. I'm surprised lein-test-refresh has different behavior.

Given that the java processes quit when run using the windows command prompt, I'm not going to continue looking into this. I just don't have the time right now to keep investigating.

I'd gladly accept a PR if you're able to figure out some thing that makes it work under Cygwin. Thanks for all the details and minimal example. It helped looking into this problem. Sorry I don't have a better answer.

tsulej commented 7 years ago

No problem. I'll try to figure out it in the future.