lagom / lagom

Reactive Microservices for the JVM
https://www.lagomframework.com
Apache License 2.0
2.63k stars 635 forks source link

Embedded Cassandra exits the JVM when running tests on Windows #435

Closed TimMoore closed 7 years ago

TimMoore commented 7 years ago

It was reported on the mailing list that service tests fail on Windows:

This appears to be because ServiceTest.withServer uses the akka.persistence.cassandra.testkit.CassandraLauncher, and calls stop() when the test completes. This calls CassandraDaemon.deactivate(), which calls CassandraDaemon.stop(), which under Windows does this:

   // On windows, we need to stop the entire system as prunsrv doesn't have the jsvc hooks
   // We rely on the shutdown hook to drain the node
   if (FBUtilities.isWindows())
       System.exit(0);

This kills the JVM before the test completes.

https://groups.google.com/d/topic/lagom-framework/jRa7e3NzPo4/discussion

Operating System

Windows

jroper commented 7 years ago

Issue raised upstream: https://github.com/akka/akka-persistence-cassandra/issues/153

TimMoore commented 7 years ago

Can we (and should we) work around it by forking Cassandra instead of embedding in the same JVM?

jroper commented 7 years ago

Yes, I think that's the only solution. Though forking is not straight forward, you need to know what the classpath of the forked process should be.

TimMoore commented 7 years ago

Fixed by #690