Skip to content

Commit 72e2f68

Browse files
committed
fix
1 parent 9bf0c49 commit 72e2f68

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

integration-test/src/test/java/org/apache/iotdb/pipe/it/single/IoTDBPipeOPCUAIT.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,27 @@ public void testOPCUAServerSink() throws Exception {
106106
env,
107107
"insert into root.db.opc(time, value, quality, other) values (1, 1, false, 1)",
108108
null);
109-
value = opcUaClient.readValue(0, TimestampsToReturn.Both, new NodeId(2, "root/db/opc")).get();
110-
Assert.assertEquals(new Variant(1.0), value.getValue());
111-
Assert.assertEquals(StatusCode.BAD, value.getStatusCode());
112-
Assert.assertEquals(new DateTime(timestampToUtc(1)), value.getSourceTime());
109+
110+
long startTime = System.currentTimeMillis();
111+
while (true) {
112+
try {
113+
value = opcUaClient.readValue(0, TimestampsToReturn.Both, new NodeId(2, "root/db/opc")).get();
114+
Assert.assertEquals(new Variant(1.0), value.getValue());
115+
Assert.assertEquals(StatusCode.BAD, value.getStatusCode());
116+
Assert.assertEquals(new DateTime(timestampToUtc(1)), value.getSourceTime());
117+
break;
118+
} catch (final Throwable t) {
119+
if (System.currentTimeMillis() - startTime > 10_000L) {
120+
throw t;
121+
}
122+
}
123+
}
113124

114125
TestUtils.executeNonQuery(
115126
env, "insert into root.db.opc(time, quality) values (2, true)", null);
116127
TestUtils.executeNonQuery(env, "insert into root.db.opc(time, value) values (2, 2)", null);
117128

118-
final long startTime = System.currentTimeMillis();
129+
startTime = System.currentTimeMillis();
119130
while (true) {
120131
try {
121132
value =

0 commit comments

Comments
 (0)