Skip to content

Commit 1107fe6

Browse files
authored
[To dev/1.3] [Test] Fix asynchronous assertions in pipe integration tests (#18941) (#18973)
1 parent 221f79c commit 1107fe6

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

‎integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeLifeCycleIT.java‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ public void testLifeCycleLogMode() throws Exception {
273273
Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"),
274274
null);
275275

276-
TestUtils.assertDataEventuallyOnEnv(
276+
// A stopped pipe must keep the receiver data unchanged.
277+
TestUtils.assertDataAlwaysOnEnv(
277278
receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
278279
}
279280
}
@@ -334,7 +335,8 @@ public void testLifeCycleFileMode() throws Exception {
334335
Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"),
335336
null);
336337

337-
TestUtils.assertDataEventuallyOnEnv(
338+
// A stopped pipe must keep the receiver data unchanged.
339+
TestUtils.assertDataAlwaysOnEnv(
338340
receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
339341
}
340342
}
@@ -395,7 +397,8 @@ public void testLifeCycleHybridMode() throws Exception {
395397
Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"),
396398
null);
397399

398-
TestUtils.assertDataEventuallyOnEnv(
400+
// A stopped pipe must keep the receiver data unchanged.
401+
TestUtils.assertDataAlwaysOnEnv(
399402
receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
400403
}
401404
}
@@ -587,8 +590,8 @@ public void testReceiverAlreadyHaveTimeSeries() throws Exception {
587590
Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"),
588591
null);
589592

590-
Thread.sleep(5000);
591-
TestUtils.assertDataEventuallyOnEnv(
593+
// A stopped pipe must keep the receiver data unchanged.
594+
TestUtils.assertDataAlwaysOnEnv(
592595
receiverEnv,
593596
"select count(*) from root.**",
594597
"count(root.db.d1.s1),",

‎integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeProtocolIT.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,8 @@ private void doTest() throws Exception {
317317
TestUtils.executeNonQueries(
318318
senderEnv, Arrays.asList("insert into root.db.d1(time,s1) values (3,3)", "flush"), null);
319319

320-
Thread.sleep(5000);
321-
TestUtils.assertDataEventuallyOnEnv(
320+
// A stopped pipe must keep the receiver data unchanged.
321+
TestUtils.assertDataAlwaysOnEnv(
322322
receiverEnv,
323323
"select count(*) from root.**",
324324
"count(root.db.d1.s1),",

0 commit comments

Comments
 (0)