Fix flaky test: LifecycleMvcAutoConfigurationTests.environmentWebEndpointExtensionEnabled
https://github.com/spring-cloud/spring-cloud-commons/actions/runs/9941908937/job/27462194088
Occured after merging: https://github.com/spring-cloud/spring-cloud-commons/commit/4e6540b2b045a8abddc876265cf0373e1bee32bd
I don't think it's a flaky test. After upgrading to boot 3.4 it fails consistently. The flaky nature was probably due to compatibility tests or something.
Also resumeEndpointGloballyDisabled after disabling environmentWebEndpointExtensionEnabled
I had a look after it failed when #1361 was merged. The problem is restartEndpointEnabled, which runs before environmentWebEndpointExtensionEnabled. When I run all tests of the class in my IDE a couple of times, I can reproduce it eventually.
The test triggers a context restart in a separate thread, and the test doesn't wait for that to finish. The subsequent test then gets ConcurrentModificationException as the logging bootstrappings get in the way of each other.