How to properly reset/shutdown axon between integration tests

97 views
Skip to first unread message

mar...@formigas.de

unread,
Jul 17, 2020, 2:35:06 AM7/17/20
to Axon Framework Users
Hi everyone!

We're running integration tests which dirty the Spring context between test runs with:

@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD)

This works. BUT: after each test is run, Axon will take an additional 1 minute for all of the connections, threads, etc to time out, after each test.

How do I properly reset/shutdown the Spring context with Axon running in it between tests?

I already tried applicationContext.getBean(EmbeddedEventStore::class.java).shutDown() but this let's the test fail.

Thanks, Martin


Steven van Beelen

unread,
Sep 16, 2020, 5:28:36 AM9/16/20
to Axon Framework Users
Hi Martin,

Axon as of 4.3 employees a grace full shutdown solution, making sure everything is closed and unsubscribed at the right time.
This solution should automatically kill everything at the end of an integration test as well, although it indeed might need some time.

So, without knowing the version you are on, I would recommend to move over to the latest (currently 4.4.2) to benefit from this.
If you already are on 4.3 or higher, then that warrants an investigation in more detail for which more information than "all of the connections, threads, etc".

Trusting this will help you further Martin!

Cheers,
Steven

PS. It is important to note that this mailing list will be discontinued as specified in this thread.
Instead of this mailing list we have moved to use a forum style of communication, at https://discuss.axoniq.io/.
Hope to see you there!

--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/axonframework/7e15a19e-6247-40c4-99e6-51c57ee9be43n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages