Copilot commented on code in PR #8181:
URL: https://github.com/apache/incubator-seata/pull/8181#discussion_r3649981249
##########
namingserver/src/test/java/org/apache/seata/namingserver/AuthControllerWithRandomPasswordTest.java:
##########
@@ -41,6 +42,15 @@
import static
org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static
org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+/**
+ * Use a unique UUID property to ensure this test class gets its own isolated
+ * Spring Boot application context rather than reusing a cached context from
+ * other RANDOM_PORT tests (e.g. NamingControllerPropertiesSmokeTest).
+ * Without this, when all namingserver tests run together, the test framework
+ * may reuse a cached context whose startup logs don't contain the
+ * "Use the auto-generated password: [...]" line, causing the test to fail.
+ */
+@TestPropertySource(properties = {"uuid=26d766d7-8aee-4940-bc50-d02ffa6e8a3a"})
Review Comment:
The class-level comment mentions “other RANDOM_PORT tests (e.g.
NamingControllerPropertiesSmokeTest)”, but this test uses plain
`@SpringBootTest` (no `webEnvironment = RANDOM_PORT`). Also, the cache-key
property name `uuid` is very generic and could collide with future
configuration keys. Consider updating the comment to match the actual setup and
use a namespaced, self-describing property key/value to isolate the context.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]