[Bug][Spring Boot] Fix AwaitingNonWebApplicationListener await() with parent context #15890
+52
−60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes made:
AwaitingNonWebApplicationListener.java
Updated await() logic to correctly handle parent contexts.
Ensures that await() completes even if the application context is not a root context.
AwaitingNonWebApplicationListenerTest.java
Rewrote the test to simulate a parent-child application context scenario.
Added an assertion to verify that await() completes successfully with a parent context.
pom.xml (dubbo-spring-boot)
Updated Maven Surefire plugin configuration to ensure JUnit Jupiter tests are executed properly.
Why this is important:
Fixes a blocking issue in non-web Spring Boot applications using Dubbo with a bootstrap parent context.
Improves test coverage to catch similar issues in the future.
Ensures consistent behavior of Dubbo application lifecycle handling.
Testing done:
Verified that AwaitingNonWebApplicationListenerTest passes locally with the updated logic.
Build succeeds with all existing tests.
Fixes #13722
please review this pr when you get time respected sir @RainYuY @AlbumenJ