Copilot commented on code in PR #13913:
URL: https://github.com/apache/ignite/pull/13913#discussion_r4798560304
##########
modules/core/src/test/java/org/apache/ignite/internal/client/thin/InvokeTest.java:
##########
@@ -79,16 +83,18 @@ public static Collection<Object> params() {
super.beforeTest();
cache = client.getOrCreateCache(new ClientCacheConfiguration()
- .setName(DEFAULT_CACHE_NAME)
+ .setName(createUniqueCacheName())
.setAtomicityMode(atomic ? CacheAtomicityMode.ATOMIC :
CacheAtomicityMode.TRANSACTIONAL)
);
+
+ awaitPartitionMapExchange();
}
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
super.afterTest();
- client.destroyCache(DEFAULT_CACHE_NAME);
+ client.destroyCache(cache.getName());
Review Comment:
`afterTest()` is also invoked when `beforeTest()` fails, but in that path
`cache` can still be null (for example if cache creation throws), so this
dereference masks the setup failure with an NPE. The field is static and is not
cleared either, so a later setup failure can attempt to destroy the previous
test's cache. Guard the cleanup and clear the reference after cleanup.
--
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]