-
Notifications
You must be signed in to change notification settings - Fork 1.1k
ConcurrentModificationException for late-registered AbstractEndpoints #9878
Description
In what version(s) of Spring Integration are you seeing this issue?
6.4.2.RELEASE
Describe the bug
After executing a test, annotated with @SpringBootTest and @SpringIntegrationTest, we saw a ConcurrentModificationException happening in SpringIntegrationTestExecutionListener.
The underlying issue was, that some logic added a new integrationFlow late (after application started). With bad timings, this happened exactly during afterTestClass execution currently looping through all AutoStartupCandidates, resulting in the exception.
To Reproduce
Register a new bean, extending AbstractEndpoint with autostartup = true exactly on test shutdown.
Expected behavior
Probably only handle Autostartup candidates, that are received during the ApplicationContext initialization (stop adding Autostartup candidates after ApplicationStarted).
Sample