wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2889749699
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/dump/IgniteCacheDumpSelf2Test.java:
##########
@@ -1219,6 +1220,185 @@ public void testReadEncrypted() throws Exception {
IntStream.range(0, KEYS_CNT).forEach(i -> assertEquals((Integer)i,
dumpEntries.get(i)));
}
+ /** */
+ private void CheckDumpReaderDebugLogsGroupName(String[] grpNames) throws
Exception {
+ String id = "test";
+
+ setLoggerDebugLevel();
+
+ ListeningTestLogger testLog = new ListeningTestLogger(log);
+
+ LogListener errLsnr = LogListener.matches("Error consuming
partition").andMatches("grp=" + GRP).build();
+ LogListener cnsmLsnr = LogListener.matches("Consuming
partition").andMatches("grp=" + GRP).build();
+
+ testLog.registerListener(errLsnr);
+ testLog.registerListener(cnsmLsnr);
+
+ IgniteEx ign0 =
startGrid(getConfiguration(id).setConsistentId(id).setGridLogger(testLog));
+
+ ign0.cluster().state(ClusterState.ACTIVE);
+
+ IgniteCache<Integer, Integer> cache = ign0.createCache(new
CacheConfiguration<Integer, Integer>()
+ .setName(CACHE_0)
+ .setGroupName(GRP)
+ .setBackups(1)
+ .setAffinity(new RendezvousAffinityFunction().setPartitions(3))
+ );
+
+ IntStream.range(0, KEYS_CNT).forEach(i -> cache.put(i, i));
+
+ ign0.snapshot().createDump(DMP_NAME, null).get(getTestTimeout());
+
+ TestDumpConsumer cnsmr = new TestDumpConsumer() {
+ @Override public void onPartition(int grp, int part,
Iterator<DumpEntry> data) {
+ throw new RuntimeException("trigger error log");
+ }
+ };
+
+ assertThrows(null, () -> new DumpReader(
+ new DumpReaderConfiguration(
+ DMP_NAME,
+ null,
+ ign0.configuration(),
+ cnsmr,
+ DFLT_THREAD_CNT,
+ DFLT_TIMEOUT,
+ true,
+ true,
+ false,
+ grpNames,
+ null,
+ false,
+ null
+ ),
+ testLog
+ ).run(), RuntimeException.class, "trigger error log");
+
+ assertTrue("Log with group name not found", errLsnr.check());
+ assertTrue("Consuming with group name not found", cnsmLsnr.check());
+ }
+
+ /** */
+ @Test
+ public void testDumpReaderDebugLogsGroupName() throws Exception {
+ CheckDumpReaderDebugLogsGroupName(new String[]{GRP});
+ }
+
+ /** */
+ @Test
+ public void testDumpReaderDebugLogsGroupNameNull() throws Exception {
Review Comment:
```suggestion
public void testDumpReaderDebugLogsNullableGroupName() throws Exception {
```
--
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]