lib/src/test/java/edu/utexas/tacc/tapis/files/lib/transfers/ITestTransfers.java
@Test(dataProvider = "testSystemsDataProvider", enabled = false)
    public void testMaxGroupSize(Pair<TapisSystem, TapisSystem> systemsPair) throws Exception {
        TapisSystem sourceSystem = systemsPair.getLeft();
        TapisSystem destSystem = systemsPair.getRight();
        log.info(sourceSystem.getId());
        log.info(destSystem.getId());
        when(systemsCache.getSystem(any(), eq("sourceSystem"), any())).thenReturn(sourceSystem);
        when(systemsCache.getSystem(any(), eq("destSystem"), any())).thenReturn(destSystem);
        when(permsService.isPermitted(any(), any(), any(), any(), any())).thenReturn(true);

        IRemoteDataClient sourceClient = remoteDataClientFactory.getRemoteDataClient(oboTenant, oboUser, sourceSystem, "testuser");
        IRemoteDataClient destClient = remoteDataClientFactory.getRemoteDataClient(oboTenant, oboUser, destSystem, "testuser");
        // Double check that the files really are in the destination
        //wipe out the dest folder just in case
        fileOpsService.delete(destClient, "/");

        //Add some files to transfer
        int FILESIZE = 10 * 1000 * 1024;
        fileOpsService.insert(sourceClient, "a/1.txt", Utils.makeFakeFile(FILESIZE));


        TransferTaskRequestElement element = new TransferTaskRequestElement();
        element.setSourceURI("tapis://sourceSystem/a/");
        element.setDestinationURI("tapis://destSystem/b/");
        List<TransferTaskRequestElement> elements = new ArrayList<>();
        elements.add(element);

        Flux<TransferTaskParent> tasks = parentTaskTransferService.runPipeline();
        tasks.subscribe();
        Flux<TransferTaskChild> stream = childTaskTransferService.runPipeline();

        for (var i=0; i<300; i++) {
            TransferTask t1 = transfersService.createTransfer(
                "testuser",
                "dev",
                "tag",
                elements
            );
        }
        AtomicInteger counter = new AtomicInteger();
        stream
            .subscribe( (t)->{
                counter.incrementAndGet();
                System.out.println(t.toString());
            }, (e)->{
                log.info(e.toString());
            });
        Thread.sleep(Duration.ofSeconds(60).toMillis());
        Assert.assertEquals(counter.get(), 300);
    }
/**
     * Tests to se if the grouping does not hang after 256 groups
     */
Tests to se if the grouping does not hang after 256 groups
Tests to se if the grouping does not hang after 256 groups
@Test(dataProvider = "testSystemsDataProvider", enabled = false)
    public void testMaxGroupSize(Pair<TapisSystem, TapisSystem> systemsPair) throws Exception {
        TapisSystem sourceSystem = systemsPair.getLeft();
        TapisSystem destSystem = systemsPair.getRight();
        log.info(sourceSystem.getId());
        log.info(destSystem.getId());
        when(systemsCache.getSystem(any(), eq("sourceSystem"), any())).thenReturn(sourceSystem);
        when(systemsCache.getSystem(any(), eq("destSystem"), any())).thenReturn(destSystem);
        when(permsService.isPermitted(any(), any(), any(), any(), any())).thenReturn(true);
        IRemoteDataClient sourceClient = remoteDataClientFactory.getRemoteDataClient(oboTenant, oboUser, sourceSystem, "testuser");
        IRemoteDataClient destClient = remoteDataClientFactory.getRemoteDataClient(oboTenant, oboUser, destSystem, "testuser");
        fileOpsService.delete(destClient, "/");
        int FILESIZE = 10 * 1000 * 1024;
        fileOpsService.insert(sourceClient, "a/1.txt", Utils.makeFakeFile(FILESIZE));
        TransferTaskRequestElement element = new TransferTaskRequestElement();
        element.setSourceURI("tapis://sourceSystem/a/");
        element.setDestinationURI("tapis://destSystem/b/");
        List<TransferTaskRequestElement> elements = new ArrayList<>();
        elements.add(element);
        Flux<TransferTaskParent> tasks = parentTaskTransferService.runPipeline();
        tasks.subscribe();
        Flux<TransferTaskChild> stream = childTaskTransferService.runPipeline();
        for (var i=0; i<300; i++) {
            TransferTask t1 = transfersService.createTransfer(
                "testuser",
                "dev",
                "tag",
                elements
            );
        }
        AtomicInteger counter = new AtomicInteger();
        stream
            .subscribe( (t)->{
                counter.incrementAndGet();
                System.out.println(t.toString());
            }, (e)->{
                log.info(e.toString());
            });
        Thread.sleep(Duration.ofSeconds(60).toMillis());
        Assert.assertEquals(counter.get(), 300);
    }
@ Test ( dataProvider = "testSystemsDataProvider" , enabled = false ) public void testMaxGroupSize ( Pair < TapisSystem , TapisSystem > systemsPair ) throws Exception { TapisSystem sourceSystem = systemsPair . getLeft ( ) ; TapisSystem destSystem = systemsPair . getRight ( ) ; log . info ( sourceSystem . getId ( ) ) ; log . info ( destSystem . getId ( ) ) ; when ( systemsCache . getSystem ( any ( ) , eq ( "sourceSystem" ) , any ( ) ) ) . thenReturn ( sourceSystem ) ; when ( systemsCache . getSystem ( any ( ) , eq ( "destSystem" ) , any ( ) ) ) . thenReturn ( destSystem ) ; when ( permsService . isPermitted ( any ( ) , any ( ) , any ( ) , any ( ) , any ( ) ) ) . thenReturn ( true ) ; IRemoteDataClient sourceClient = remoteDataClientFactory . getRemoteDataClient ( oboTenant , oboUser , sourceSystem , "testuser" ) ; IRemoteDataClient destClient = remoteDataClientFactory . getRemoteDataClient ( oboTenant , oboUser , destSystem , "testuser" ) ; fileOpsService . delete ( destClient , "/" ) ; int FILESIZE = 10 * 1000 * 1024 ; fileOpsService . insert ( sourceClient , "a/1.txt" , Utils . makeFakeFile ( FILESIZE ) ) ; TransferTaskRequestElement element = new TransferTaskRequestElement ( ) ; element . setSourceURI ( "tapis://sourceSystem/a/" ) ; element . setDestinationURI ( "tapis://destSystem/b/" ) ; List < TransferTaskRequestElement > elements = new ArrayList < > ( ) ; elements . add ( element ) ; Flux < TransferTaskParent > tasks = parentTaskTransferService . runPipeline ( ) ; tasks . subscribe ( ) ; Flux < TransferTaskChild > stream = childTaskTransferService . runPipeline ( ) ; for ( var i = 0 ; i < 300 ; i ++ ) { TransferTask t1 = transfersService . createTransfer ( "testuser" , "dev" , "tag" , elements ) ; } AtomicInteger counter = new AtomicInteger ( ) ; stream . subscribe ( ( t ) -> { counter . incrementAndGet ( ) ; System . out . println ( t . toString ( ) ) ; } , ( e ) -> { log . info ( e . toString ( ) ) ; } ) ; Thread . sleep ( Duration . ofSeconds ( 60 ) . toMillis ( ) ) ; Assert . assertEquals ( counter . get ( ) , 300 ) ; }
Tests to se if the grouping does not hang after 256 groups
Tests to se if the grouping does not hang after 256 groups
// Double check that the files really are in the destination //wipe out the dest folder just in case //Add some files to transfer