@@ -91,14 +91,10 @@ public void testDoubleLivingAutoConflict() throws Exception {
9191 final int receiverPort = receiverDataNode .getPort ();
9292
9393 for (int i = 0 ; i < 100 ; ++i ) {
94- if (!TestUtils .tryExecuteNonQueryWithRetry (
95- senderEnv , String .format ("insert into root.db.d1(time, s1) values (%s, 1)" , i ))) {
96- return ;
97- }
98- }
99- if (!TestUtils .tryExecuteNonQueryWithRetry (senderEnv , "flush" )) {
100- return ;
94+ TestUtils .executeNonQuery (
95+ senderEnv , String .format ("insert into root.db.d1(time,s1) values (%s,1)" , i ), null );
10196 }
97+ TestUtils .executeNonQuery (senderEnv , "flush" , null );
10298
10399 try (final SyncConfigNodeIServiceClient client =
104100 (SyncConfigNodeIServiceClient ) senderEnv .getLeaderConfigNodeConnection ()) {
@@ -127,24 +123,16 @@ public void testDoubleLivingAutoConflict() throws Exception {
127123 TSStatusCode .SUCCESS_STATUS .getStatusCode (), client .startPipe ("p1" ).getCode ());
128124 }
129125 for (int i = 100 ; i < 200 ; ++i ) {
130- if (!TestUtils .tryExecuteNonQueryWithRetry (
131- senderEnv , String .format ("insert into root.db.d1(time, s1) values (%s, 1)" , i ))) {
132- return ;
133- }
134- }
135- if (!TestUtils .tryExecuteNonQueryWithRetry (senderEnv , "flush" )) {
136- return ;
126+ TestUtils .executeNonQuery (
127+ senderEnv , String .format ("insert into root.db.d1(time,s1) values (%s,1)" , i ), null );
137128 }
129+ TestUtils .executeNonQuery (senderEnv , "flush" , null );
138130
139131 for (int i = 200 ; i < 300 ; ++i ) {
140- if (!TestUtils .tryExecuteNonQueryWithRetry (
141- receiverEnv , String .format ("insert into root.db.d1(time, s1) values (%s, 1)" , i ))) {
142- return ;
143- }
144- }
145- if (!TestUtils .tryExecuteNonQueryWithRetry (receiverEnv , "flush" )) {
146- return ;
132+ TestUtils .executeNonQuery (
133+ receiverEnv , String .format ("insert into root.db.d1(time,s1) values (%s,1)" , i ), null );
147134 }
135+ TestUtils .executeNonQuery (receiverEnv , "flush" , null );
148136
149137 try (final SyncConfigNodeIServiceClient client =
150138 (SyncConfigNodeIServiceClient ) receiverEnv .getLeaderConfigNodeConnection ()) {
@@ -173,14 +161,10 @@ public void testDoubleLivingAutoConflict() throws Exception {
173161 TSStatusCode .SUCCESS_STATUS .getStatusCode (), client .startPipe ("p1" ).getCode ());
174162 }
175163 for (int i = 300 ; i < 400 ; ++i ) {
176- if (!TestUtils .tryExecuteNonQueryWithRetry (
177- receiverEnv , String .format ("insert into root.db.d1(time, s1) values (%s, 1)" , i ))) {
178- return ;
179- }
180- }
181- if (!TestUtils .tryExecuteNonQueryWithRetry (receiverEnv , "flush" )) {
182- return ;
164+ TestUtils .executeNonQuery (
165+ receiverEnv , String .format ("insert into root.db.d1(time,s1) values (%s,1)" , i ), null );
183166 }
167+ TestUtils .executeNonQuery (receiverEnv , "flush" , null );
184168
185169 final Set <String > expectedResSet = new HashSet <>();
186170 for (int i = 0 ; i < 400 ; ++i ) {
@@ -201,23 +185,15 @@ public void testDoubleLivingAutoConflict() throws Exception {
201185 }
202186
203187 for (int i = 400 ; i < 500 ; ++i ) {
204- if (!TestUtils .tryExecuteNonQueryWithRetry (
205- senderEnv , String .format ("insert into root.db.d1(time, s1) values (%s, 1)" , i ))) {
206- return ;
207- }
208- }
209- if (!TestUtils .tryExecuteNonQueryWithRetry (senderEnv , "flush" )) {
210- return ;
188+ TestUtils .executeNonQuery (
189+ senderEnv , String .format ("insert into root.db.d1(time,s1) values (%s,1)" , i ), null );
211190 }
191+ TestUtils .executeNonQuery (senderEnv , "flush" , null );
212192 for (int i = 500 ; i < 600 ; ++i ) {
213- if (!TestUtils .tryExecuteNonQueryWithRetry (
214- receiverEnv , String .format ("insert into root.db.d1(time, s1) values (%s, 1)" , i ))) {
215- return ;
216- }
217- }
218- if (!TestUtils .tryExecuteNonQueryWithRetry (receiverEnv , "flush" )) {
219- return ;
193+ TestUtils .executeNonQuery (
194+ receiverEnv , String .format ("insert into root.db.d1(time,s1) values (%s,1)" , i ), null );
220195 }
196+ TestUtils .executeNonQuery (receiverEnv , "flush" , null );
221197
222198 for (int i = 400 ; i < 600 ; ++i ) {
223199 expectedResSet .add (i + ",1.0," );
@@ -290,37 +266,28 @@ public void testDoubleLivingAutoConflictTemplate() throws Exception {
290266 TSStatusCode .SUCCESS_STATUS .getStatusCode (), client .startPipe ("p1" ).getCode ());
291267 }
292268
293- if (!TestUtils .tryExecuteNonQueriesWithRetry (
269+ // Auto extend s1
270+ TestUtils .executeNonQueries (
294271 senderEnv ,
295272 Arrays .asList (
296- // Auto extend s1
297- "create schema template t1 (s2 INT64 encoding=RLE, s3 INT64 encoding=RLE compression=SNAPPY)" ,
273+ "create schema template t1 (s2 INT64 encoding=RLE,s3 INT64 encoding=RLE compression=SNAPPY)" ,
298274 "create database root.db" ,
299- "set device template t1 to root.db" ))) {
300- return ;
301- }
275+ "set device template t1 to root.db" ),
276+ null );
302277
303278 for (int i = 0 ; i < 200 ; ++i ) {
304- if (!TestUtils .tryExecuteNonQueryWithRetry (
305- senderEnv , String .format ("insert into root.db.d1(time, s1) values (%s, 1)" , i ))) {
306- return ;
307- }
279+ TestUtils .executeNonQuery (
280+ senderEnv , String .format ("insert into root.db.d1(time,s1) values (%s,1)" , i ), null );
308281 }
309282
310283 for (int i = 200 ; i < 400 ; ++i ) {
311- if (!TestUtils .tryExecuteNonQueryWithRetry (
312- receiverEnv , String .format ("insert into root.db.d1(time, s1) values (%s, 1)" , i ))) {
313- return ;
314- }
284+ TestUtils .executeNonQuery (
285+ receiverEnv , String .format ("insert into root.db.d1(time,s1) values (%s,1)" , i ), null );
315286 }
316287
317- if (!TestUtils .tryExecuteNonQueryWithRetry (senderEnv , "flush" )) {
318- return ;
319- }
288+ TestUtils .executeNonQuery (senderEnv , "flush" , null );
320289
321- if (!TestUtils .tryExecuteNonQueryWithRetry (receiverEnv , "flush" )) {
322- return ;
323- }
290+ TestUtils .executeNonQuery (receiverEnv , "flush" , null );
324291
325292 final Set <String > expectedResSet = new HashSet <>();
326293 for (int i = 0 ; i < 400 ; ++i ) {
@@ -363,16 +330,13 @@ public void testAutoManualCreateRace() throws Exception {
363330 Assert .assertEquals (
364331 TSStatusCode .SUCCESS_STATUS .getStatusCode (), client .startPipe ("testPipe" ).getCode ());
365332
366- if (!TestUtils .tryExecuteNonQueryWithRetry (
367- receiverEnv , "create timeSeries root.ln.wf01.wt01.status with datatype=BOOLEAN" )) {
368- return ;
369- }
333+ TestUtils .executeNonQuery (
334+ receiverEnv , "create timeSeries root.ln.wf01.wt01.status with datatype=BOOLEAN" , null );
370335
371- if (! TestUtils .tryExecuteNonQueryWithRetry (
336+ TestUtils .executeNonQuery (
372337 senderEnv ,
373- "create timeSeries root.ln.wf01.wt01.status with datatype=BOOLEAN tags (tag3=v3) attributes (attr4=v4)" )) {
374- return ;
375- }
338+ "create timeSeries root.ln.wf01.wt01.status with datatype=BOOLEAN tags (tag3=v3) attributes (attr4=v4)" ,
339+ null );
376340
377341 TestUtils .assertDataEventuallyOnEnv (
378342 receiverEnv ,
@@ -393,7 +357,7 @@ public void testHistoricalActivationRace() throws Exception {
393357 try (final SyncConfigNodeIServiceClient client =
394358 (SyncConfigNodeIServiceClient ) senderEnv .getLeaderConfigNodeConnection ()) {
395359
396- if (! TestUtils .tryExecuteNonQueriesWithRetry (
360+ TestUtils .executeNonQueries (
397361 senderEnv ,
398362 Arrays .asList (
399363 "create database root.sg_aligned" ,
@@ -404,9 +368,8 @@ public void testHistoricalActivationRace() throws Exception {
404368 "insert into root.sg_aligned.device_aligned.d10(time, s0, s1, s2,s3,s4,s5) values (1706659200,1706659200,10,20.245,25.24555,true,''),(1706662800,null,1706662800,20.241,25.24111,false,'2'),(1706666400,3,null,20.242,25.24222,true,'3'),(1706670000,4,40,null,35.5474,true,'4'),(1706670600,5,1706670600000,20.246,null,false,'5'),(1706671200,6,60,20.248,25.24888,null,'6'),(1706671800,7,1706671800,20.249,25.24999,false,null),(1706672400,8,80,1245.392,75.51234,false,'8'),(1706672600,9,90,2345.397,2285.58734,false,'9'),(1706673000,10,100,20.241,25.24555,false,'10'),(1706673600,11,110,3345.394,4105.544,false,'11'),(1706674200,12,1706674200,30.245,35.24555,false,'12'),(1706674800,13,130,5.39,125.51234,false,'13'),(1706675400,14,1706675400,5.39,135.51234,false,'14'),(1706676000,15,150,5.39,145.51234,false,'15'),(1706676600,16,160,5.39,155.51234,false,'16'),(1706677200,17,170,5.39,165.51234,false,'17'),(1706677600,18,180,5.39,175.51234,false,'18'),(1706677800,19,190,5.39,185.51234,false,'19'),(1706678000,20,200,5.39,195.51234,false,'20'),(1706678200,21,210,5.39,null,false,'21')" ,
405369 "insert into root.sg_aligned.device_aligned.d10(time, s0, s1, s2,s3,s4,s5) values (-1,1,10,5.39,5.51234,false,'negative')" ,
406370 "insert into root.sg_aligned.device_aligned.d11(time, s0, s1, s2,s3,s4,s5) values (-1,-11,-110,-5.39,-5.51234,false,'activate:1')" ,
407- "insert into root.sg_aligned.device_aligned.d10(time, s0, s1, s2,s3,s4,s5,s6) values(1706678800,1,1706678800,5.39,5.51234,false,'add:s6',32);" ))) {
408- return ;
409- }
371+ "insert into root.sg_aligned.device_aligned.d10(time, s0, s1, s2,s3,s4,s5,s6) values(1706678800,1,1706678800,5.39,5.51234,false,'add:s6',32);" ),
372+ null );
410373
411374 final Map <String , String > extractorAttributes = new HashMap <>();
412375 final Map <String , String > processorAttributes = new HashMap <>();
0 commit comments