Hi, you're absolutely right, if you want to do a Black-Box Test without internal checks, like services are all set etc. Then it's best to run the container with a docker image, fire your tests on it and let it die ;) Did you check the docker-maven-plugin for generating a custom Karaf Docker image from maven? [1] The nice thing about it you also can start and stop a docker image with that maven plugin. Btw. I did take a look at those thread dumps, but unfortunately I wasn't capable of finding any gremlins in there ;)
regards, Achim [1] - https://github.com/ANierbeck/Karaf-Microservices-Tooling/blob/master/Karaf-Service-Docker/pom.xml#L28-L30 2016-10-25 20:53 GMT+02:00 Benson Margulies <[email protected]>: > > > On Tue, Oct 25, 2016 at 2:36 PM, 'Achim Nierbeck' via OPS4J < > [email protected]> wrote: > >> Well ... you're doing something different there ... you're using it as >> Server. >> please don't nail me on it, but I've seen a similar problem arise in >> former times with any kind of container started by a maven test. Sometimes >> those maven teardowns aren't good on timing and especially waiting for a >> container to finish on it. >> >> > > I'm not in this to give anyone a hard time. Honestly, since we don't need > to run any tests inside the container, it makes more sense for us to do > what we're now planning to do, which is to launch and shutdown the server > via Docker, and then just run ordinary JUnit tests. For your information, > I've seen this 'stuck on shutdown' both with the exam-maven-plugin and > using the karaf container from Junit. I wouldn't be surprised to learn that > we've coded something wrong. or that Junit has a bug. Or that we've got an > infestation of gremlins. If you or any of the others happen to look at the > thread dumps I posted and glean some insight, you might be able to give > David some relief. > > >> regards, Achim >> >> >> 2016-10-25 20:12 GMT+02:00 Benson Margulies <[email protected]>: >> >>> >>> >>> On Tue, Oct 25, 2016 at 1:58 PM, 'Achim Nierbeck' via OPS4J < >>> [email protected]> wrote: >>> >>>> Hi, >>>> >>>> I haven't seen stuck Karafs now for a long time. So usually it's a hint >>>> of a malfunctional test. >>>> >>> >>> Nope. It gets stuck after the last test case has run, somewhere in the >>> tear-down process. And it fails when the tests all _succeed_. >>> >>> I posted the thread dumps. >>> >>> It only fails sporadically. And it happens, now, to both David and me. >>> >>> >>> >>> >>>> Especially if the test fails hard in a way that the tear down of the >>>> karaf can't be run anymore. >>>> Therefore first make sure your tests are "safe" enough to not block a >>>> tear down, or release ports which are allocated with your applications. >>>> Btw. Karaf itself and also the Pax-Web tests do successfully use the >>>> Pax-Exam with Karaf, therefore maybe taking a look >>>> at both projects might help to find some pointers :-) >>>> >>>> regards, Achim >>>> >>>> >>>> 2016-10-25 19:13 GMT+02:00 Benson Margulies <[email protected]>: >>>> >>>>> The alternative you have is to use the exam-maven-plugin if you don't >>>>> need to inject test cases into the container. However, I've also seen that >>>>> get stuck on shutdown. >>>>> >>>>> >>>>> On Tue, Oct 25, 2016 at 1:12 PM, David Karr < >>>>> [email protected]> wrote: >>>>> >>>>>> Ah. Now I see that it doesn't even matter, as PerSuite is not >>>>>> supported for OSGi or Karaf modes. >>>>>> >>>>>> On Tuesday, October 25, 2016 at 9:36:14 AM UTC-7, David Karr wrote: >>>>>>> >>>>>>> I'm working in a largish project, with multiple subprojects, each of >>>>>>> which have PaxExam-based integration tests. >>>>>>> >>>>>>> Presently, all of the tests are using the PerClass reactor strategy. >>>>>>> >>>>>>> When I run the "integration-test" goal from the top-level, it runs >>>>>>> all of the integration tests in the entire project. This is something >>>>>>> that >>>>>>> I eventually want to run from CI, but only if it can be done reliably. >>>>>>> >>>>>>> Presently, we're seeing issues where the Karaf container fails to >>>>>>> shut down properly, resulting in the next test failing with "address in >>>>>>> use" errors. I'm considering all possible mitigation strategies for >>>>>>> this >>>>>>> problem. >>>>>>> >>>>>>> I noticed that another reactor strategy is "PerSuite". This is a >>>>>>> very long shot, but is there any chance the impact of using this is that >>>>>>> all of the integration tests in the entire project would use the same >>>>>>> container? I think this is unlikely, but I figured I might as well >>>>>>> ask. I >>>>>>> understand that even if this works, there are potential tradeoffs from >>>>>>> lack >>>>>>> of isolation of tests, but a test that fails because it can't start up >>>>>>> Karaf is worse than that. >>>>>>> >>>>>> -- >>>>>> -- >>>>>> ------------------ >>>>>> OPS4J - http://www.ops4j.org - [email protected] >>>>>> >>>>>> --- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "OPS4J" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>> send an email to [email protected]. >>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>> >>>>> >>>>> -- >>>>> -- >>>>> ------------------ >>>>> OPS4J - http://www.ops4j.org - [email protected] >>>>> >>>>> --- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "OPS4J" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to [email protected]. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> >>>> >>>> -- >>>> >>>> Apache Member >>>> Apache Karaf <http://karaf.apache.org/> Committer & PMC >>>> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> >>>> Committer & Project Lead >>>> blog <http://notizblog.nierbeck.de/> >>>> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS> >>>> >>>> Software Architect / Project Manager / Scrum Master >>>> >>>> -- >>>> -- >>>> ------------------ >>>> OPS4J - http://www.ops4j.org - [email protected] >>>> >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "OPS4J" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >>> -- >>> ------------------ >>> OPS4J - http://www.ops4j.org - [email protected] >>> >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "OPS4J" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> >> Apache Member >> Apache Karaf <http://karaf.apache.org/> Committer & PMC >> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer >> & Project Lead >> blog <http://notizblog.nierbeck.de/> >> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS> >> >> Software Architect / Project Manager / Scrum Master >> >> -- >> -- >> ------------------ >> OPS4J - http://www.ops4j.org - [email protected] >> >> --- >> You received this message because you are subscribed to the Google Groups >> "OPS4J" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > -- > ------------------ > OPS4J - http://www.ops4j.org - [email protected] > > --- > You received this message because you are subscribed to the Google Groups > "OPS4J" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- Apache Member Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead blog <http://notizblog.nierbeck.de/> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS> Software Architect / Project Manager / Scrum Master -- -- ------------------ OPS4J - http://www.ops4j.org - [email protected] --- You received this message because you are subscribed to the Google Groups "OPS4J" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
