Open aramcodz opened 7 years ago
@aramcodz Can you trace/debug the the problem with loggers in the code of Embedded Postgres? You could send a PR, which is always welcome.
The ClassNotFoundException
makes me thinking that there's strange behaviour of the library within Plexus classloaders. It would be helpful if you could create an example project, we could play with.
Could not delete pid file
fixed in PR https://github.com/flapdoodle-oss/de.flapdoodle.embed.process/pull/59 ...
I have created a maven-plugin that wraps around the postgresql-embedded component, using it to successfully start an embedded postgres process during the pre-integration phase of the maven lifecycle and stop/shutdown the process during the post-integration-phase of the lifecycle. I got the idea after posting this stackoverflow question and got a great response by user tunaki.
Doing my testing on Mac OSX (El Capitan/10.11.5) with maven Apache Maven 3.3.9 and java 8.
And, from my pom file:
I believe most of the functionality is working properly, except for the shutdown process. The code is managed by a PostgresEmbeddedService class. Here is what my
start()
method looks like:And, here is my
stop()
method:Note that
postgresProcess
is an instance member of the class. It is instantiated instart()
and held in memory as long as the maven process continues untilstop()
is called in post-integration-test.Here is the problem I am seeing. It seems that the
process.stop()
is kind of working, but outputs some confusing console/log output. Here is the excerpt from my maven console (in debug mode - first line is my log statement from myPostgresEmbeddedService
class):That last line is log statement from my class
PostgresEmbeddedService
. It seems like the actual server process is indeed being stopped. When I acutally look for that process with PID 1043:Also, please note this output at the very end of my maven run:
Further, I also notice that the maven temp file (/var/folders/8g/69wh31fn7nx3q81phwfdpld00000gn/T/postgresql-embed-9e977da4-fb54-414e-b5ca-566936bc4549) _has actually_ been cleaned up/removed:
So, is this mainly an issue with logging? Is there some thread-related timing issue going on here? Is this stop() process working properly with only some bad logging messages?
It seems like the issue is logging/console output only, but I found the messages confusing.
Thanks in advance for any help/feedback.
--Aram