@@ -88,8 +88,8 @@ public void setUp() {
8888 .setIsPipeEnableMemoryCheck (false )
8989 .setPipeAutoSplitFullEnabled (false );
9090
91- senderEnv .initClusterEnvironment ();
92- receiverEnv .initClusterEnvironment (3 , 3 );
91+ senderEnv .initClusterEnvironment (1 , 1 );
92+ receiverEnv .initClusterEnvironment (1 , 1 );
9393 }
9494
9595 @ Test
@@ -274,13 +274,6 @@ public void testSourcePermission() {
274274 e .getMessage ().contains ("Fail to CREATE_PIPE because Authentication failed." ));
275275 }
276276
277- // Test snapshot filter
278- TestUtils .executeNonQueries (
279- senderEnv ,
280- Arrays .asList (
281- "create database root.db" , "create timeSeries root.db.device.measurement int32" ),
282- null );
283-
284277 // Use current session, user is root
285278 try (final Connection connection = senderEnv .getConnection ();
286279 final Statement statement = connection .createStatement ()) {
@@ -324,6 +317,32 @@ public void testSourcePermission() {
324317 TestUtils .assertDataAlwaysOnEnv (
325318 receiverEnv , "count databases" , "count," , Collections .singleton ("0," ));
326319
320+ // Test snapshot filter
321+ TestUtils .executeNonQueries (
322+ senderEnv ,
323+ Arrays .asList (
324+ "create database root.db" , "create timeSeries root.db.device.measurement int32" ),
325+ null );
326+
327+ // Transfer snapshot
328+ try (final Connection connection = senderEnv .getConnection ();
329+ final Statement statement = connection .createStatement ()) {
330+ statement .execute ("drop pipe a2b" );
331+ statement .execute (
332+ String .format (
333+ "create pipe a2b"
334+ + " with source ("
335+ + "'inclusion'='all', "
336+ + "'username'='thulab', "
337+ + "'password'='passwD@123456')"
338+ + " with sink ("
339+ + "'node-urls'='%s')" ,
340+ receiverEnv .getDataNodeWrapperList ().get (0 ).getIpAndPortString ()));
341+ } catch (final SQLException e ) {
342+ e .printStackTrace ();
343+ fail ("Shall not fail if user and password are specified" );
344+ }
345+
327346 TestUtils .executeNonQuery (receiverEnv , "create database root.db" );
328347
329348 // root.db.device.measurement shall not be transferred
0 commit comments