luoluoyuyu commented on code in PR #17756:
URL: https://github.com/apache/iotdb/pull/17756#discussion_r3309321790
##########
integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeAutoSplitIT.java:
##########
@@ -161,4 +157,18 @@ public void testSingleEnv() throws Exception {
"Time,root.test.device.field,",
Collections.singleton("1,2.0,"));
}
+
+ private void assertAutoSplitResult(
+ final List<TShowPipeInfo> showPipeResult, final String pipeName) {
+ // The history pipe may have already been auto-dropped after snapshot
transfer completes.
+ Assert.assertTrue(
+ showPipeResult.stream().anyMatch(i -> Objects.equals(i.id, pipeName +
"_realtime")));
+ Assert.assertFalse(showPipeResult.stream().anyMatch(i ->
Objects.equals(i.id, pipeName)));
Review Comment:
nit: `Assert.assertFalse(showPipeResult.stream().anyMatch(...))` 可简写为
`Assert.assertTrue(showPipeResult.stream().noneMatch(i -> Objects.equals(i.id,
pipeName)))`,语义相同。
另:若未来存在**第三个**与 `pipeName` 前缀相关但非 `_history/_realtime` 的 pipe(例如手动创建的
`a2b_custom`),`allMatch` 仍会通过。若需更严,可改为:
```java
final long related = showPipeResult.stream().filter(i ->
i.getId().startsWith(pipeName)).count();
Assert.assertEquals(2, related); // or 1 if history already dropped
```
当前实现已足够修 flake,非阻塞。
--
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]