Open erikonthenet opened 8 years ago
This is because Spring TestNG test support closes the application context automatically after all tests are finished.
The shutdown process of the application context is done before after suite actions in Citrus are started. Then shutdown and after suite actions are running in parallel as you suggested. I need to find out if we can influence the order of after suite operations so Citrus actions are executed before the application context is shut down.
Environment: the service (jdk-8) runs locally with jetty. The citrus tests (2.5.2), run with maven-failsafe-plugin. DB: Postgresql, JMS: HornetQ.
In our service tests we enqueue messages onto the IN-queue, the service does magic and produces a message on the OUT-queue. Most tests use receive-actions to validate the message. But not all messages are received, or maybe a test-build fails. That's why we like to purge the OUT-Q at the end of all tests. According to the documentation the "After Suite" would be the place to clean up JMS destinations. So we use the testcase:after-suite with action "purge-endpoint".
Sometimes messages are indeed purged (received), but other times, the logging shows an IllegalStateException: Session is closed. I suspect that connections are being closed in a parallel process which sometimes results in a failure while purging the JMS endpoint (hornetq-queue).
Can you confirm/fix this? Thanks in advance!
Kind regards, Erik Loosman
Failure example:
Success example