Caideyipi commented on code in PR #18648:
URL: https://github.com/apache/iotdb/pull/18648#discussion_r4043092873


##########
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/pattern/CachedSchemaPatternMatcherTest.java:
##########
@@ -73,6 +81,25 @@ public boolean shouldParsePattern() {
     }
   }
 
+  private static class CountingCachedSchemaPatternMatcher extends 
CachedSchemaPatternMatcher {
+
+    private int tableMatchCount;
+
+    @Override
+    protected void matchTableModelEvent(
+        final String databaseName,
+        final String tableName,
+        final Set<PipeRealtimeDataRegionSource> matchedSources) {
+      ++tableMatchCount;
+      // Simulate a successful table-level match so this test focuses on match 
orchestration.
+      matchedSources.addAll(sources);

Review Comment:
   **[P2] Make this test fail without table deduplication**
   
   With one registered source, `matchedSources.addAll(sources)` fills the set 
on the first table, so the matcher exits before it reaches the second device. 
The pre-change implementation therefore also reports `tableMatchCount == 1`, 
and this test would pass without the new `tableNames.add(...)` guard. Please 
register at least two sources and add only one (or otherwise keep the match set 
incomplete) so a duplicate invocation is observable.



-- 
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]

Reply via email to