garyrussell/spring-integration — comment on commit d656a3eb260e5c9c89bb01ec964d5931868109da
File:  line 0
By garyrussell:

I am not a big fan of putting arbitrary delays in tests "hoping" that something will happen in time. Typically you have to pick a delay that will be big enough such that you have a close to 100% chance it will happen (on a heavily loaded build system), but small enough so as to not unnecessarily extend the time it takes to run the test.

What you are suggesting will work fine until the first time there happens to be a glitch on the build server where we get thread starvation for 2 seconds.

While the reflection is ugly, it seems clear to me what the code is doing (but maybe that's because I wrote it).

Sure, a 2 second delay in this one test is not that big a deal, but cumulatively they add up to a lot of wasted time. I would not be surprised that if we could remove all of the "hope" delays in all the SI tests, the build time would come down significantly.

Regarding the start(), I would leave it there because I expect the listener container lifecycle issues to be fixed.