spring-cloud-commons icon indicating copy to clipboard operation
spring-cloud-commons copied to clipboard

Fix flaky test: LifecycleMvcAutoConfigurationTests.environmentWebEndpointExtensionEnabled

Open OlgaMaciaszek opened this issue 1 year ago • 3 comments

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

OlgaMaciaszek avatar Jul 15 '24 15:07 OlgaMaciaszek

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.

spencergibb avatar Aug 05 '24 17:08 spencergibb

Also resumeEndpointGloballyDisabled after disabling environmentWebEndpointExtensionEnabled

spencergibb avatar Aug 05 '24 17:08 spencergibb

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.

hpoettker avatar Aug 06 '24 07:08 hpoettker