annhchen89 opened a new pull request, #6245: URL: https://github.com/apache/shenyu/pull/6245
<!-- Describe your PR here; e.g. Fixes #issueNo --> ### What is the purpose of the change AiPromptPluginDataHandler stores AiPromptConfig inside a static cache via: ``` Singleton.INST.single(AiPromptConfig.class, config); ``` Because SINGLES is static and shared across all tests, running: `testHandlerPluginWithValidData` (polluter), then `testHandlerPluginWithNullData` (victam), causes nondeterministic test failures. The second test fails when the leftover state from the first test remains in the global cache. ### The Fix Clear the actual static SINGLES map directly using reflection before each test in the `@BeforeEach` --- <!-- Thank you for proposing a pull request. This template will guide you through the essential steps necessary for a pull request. --> Make sure that: - [x] You have read the [contribution guidelines](https://shenyu.apache.org/community/contributor-guide). - [x] You submit test cases (unit or integration tests) that back your changes. - [x] Your local test passed `./mvnw clean install -Dmaven.javadoc.skip=true`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
