Prior to this commit the StartupStep.end method was being called from the default step action. However when overriding the default step action this might lead to the StartupStep.end method not being called. As in the case of a failure, as that enriches the information being written.

This commit also introduces a test for the failure case showing that there is a missed call to end with the initial solution.

See: gh-22776

Comment From: mdeinum

@bclozel There appears to be still a missing call to a StartupStep.end() in case of failure during startup, which that is I couldn't determine (might be one in Spring itself.

Another note I couldn't run the tests locally it was hanging on the BuildImageTests (or at least it appeared that way as it didn't progress).

Comment From: mdeinum

@bclozel https://github.com/spring-projects/spring-framework/pull/25572 (in Spring Framework Repository) fixes the missing call to end. It was the spring.beans.instantiate that wasn't ended when an error occurred.

Comment From: philwebb

This one was my fault, I messed up in a polish commit.

Comment From: mdeinum

Just noticed 4 test failures on Concourse-ci, however, it is 4 times the same test, appears that tests are either counted or run multiple times?

The test is failing due to the linked Spring Framework issue.

Comment From: philwebb

Thanks @mdeinum! I've tweaked the test for now until the Framework issue is fixed.