@@ -506,10 +506,17 @@ func startClickHouseContainer(ctx context.Context) (testcontainers.Container, er
506
506
},
507
507
WaitingFor : wait .ForHTTP ("/" ).WithPort ("8123/tcp" ),
508
508
}
509
- return testcontainers .GenericContainer (ctx , testcontainers.GenericContainerRequest {
509
+ c , err := testcontainers .GenericContainer (ctx , testcontainers.GenericContainerRequest {
510
510
ContainerRequest : req ,
511
511
Reuse : false ,
512
512
})
513
+ if err != nil {
514
+ return nil , err
515
+ }
516
+ if err := c .Start (ctx ); err != nil {
517
+ return nil , err
518
+ }
519
+ return c , nil
513
520
}
514
521
515
522
func startMinioContainer (ctx context.Context ) (testcontainers.Container , error ) {
@@ -526,10 +533,17 @@ func startMinioContainer(ctx context.Context) (testcontainers.Container, error)
526
533
},
527
534
WaitingFor : wait .ForHTTP ("/minio/health/ready" ).WithPort ("9000/tcp" ).WithStartupTimeout (2 * time .Minute ),
528
535
}
529
- return testcontainers .GenericContainer (ctx , testcontainers.GenericContainerRequest {
536
+ c , err := testcontainers .GenericContainer (ctx , testcontainers.GenericContainerRequest {
530
537
ContainerRequest : req ,
531
538
Reuse : false ,
532
539
})
540
+ if err != nil {
541
+ return nil , err
542
+ }
543
+ if err := c .Start (ctx ); err != nil {
544
+ return nil , err
545
+ }
546
+ return c , nil
533
547
}
534
548
535
549
func startFakeGCSContainer (ctx context.Context ) (testcontainers.Container , error ) {
@@ -540,10 +554,17 @@ func startFakeGCSContainer(ctx context.Context) (testcontainers.Container, error
540
554
Cmd : []string {"-scheme" , "http" },
541
555
WaitingFor : wait .ForHTTP ("/" ).WithPort ("4443/tcp" ),
542
556
}
543
- return testcontainers .GenericContainer (ctx , testcontainers.GenericContainerRequest {
557
+ c , err := testcontainers .GenericContainer (ctx , testcontainers.GenericContainerRequest {
544
558
ContainerRequest : req ,
545
559
Reuse : false ,
546
560
})
561
+ if err != nil {
562
+ return nil , err
563
+ }
564
+ if err := c .Start (ctx ); err != nil {
565
+ return nil , err
566
+ }
567
+ return c , nil
547
568
}
548
569
549
570
func startAzuriteContainer (ctx context.Context ) (testcontainers.Container , error ) {
@@ -554,10 +575,17 @@ func startAzuriteContainer(ctx context.Context) (testcontainers.Container, error
554
575
Cmd : []string {"azurite-blob" , "--blobHost" , "0.0.0.0" },
555
576
WaitingFor : wait .ForListeningPort ("10000/tcp" ),
556
577
}
557
- return testcontainers .GenericContainer (ctx , testcontainers.GenericContainerRequest {
578
+ c , err := testcontainers .GenericContainer (ctx , testcontainers.GenericContainerRequest {
558
579
ContainerRequest : req ,
559
580
Reuse : false ,
560
581
})
582
+ if err != nil {
583
+ return nil , err
584
+ }
585
+ if err := c .Start (ctx ); err != nil {
586
+ return nil , err
587
+ }
588
+ return c , nil
561
589
}
562
590
563
591
func startFTPContainer (ctx context.Context ) (testcontainers.Container , error ) {
@@ -572,10 +600,17 @@ func startFTPContainer(ctx context.Context) (testcontainers.Container, error) {
572
600
},
573
601
WaitingFor : wait .ForListeningPort ("21/tcp" ),
574
602
}
575
- return testcontainers .GenericContainer (ctx , testcontainers.GenericContainerRequest {
603
+ c , err := testcontainers .GenericContainer (ctx , testcontainers.GenericContainerRequest {
576
604
ContainerRequest : req ,
577
605
Reuse : false ,
578
606
})
607
+ if err != nil {
608
+ return nil , err
609
+ }
610
+ if err := c .Start (ctx ); err != nil {
611
+ return nil , err
612
+ }
613
+ return c , nil
579
614
}
580
615
581
616
func startSFTPContainer (ctx context.Context ) (testcontainers.Container , error ) {
@@ -588,10 +623,17 @@ func startSFTPContainer(ctx context.Context) (testcontainers.Container, error) {
588
623
},
589
624
WaitingFor : wait .ForListeningPort ("22/tcp" ),
590
625
}
591
- return testcontainers .GenericContainer (ctx , testcontainers.GenericContainerRequest {
626
+ c , err := testcontainers .GenericContainer (ctx , testcontainers.GenericContainerRequest {
592
627
ContainerRequest : req ,
593
628
Reuse : false ,
594
629
})
630
+ if err != nil {
631
+ return nil , err
632
+ }
633
+ if err := c .Start (ctx ); err != nil {
634
+ return nil , err
635
+ }
636
+ return c , nil
595
637
}
596
638
597
639
func createTestTables (ctx context.Context , t * testing.T , container testcontainers.Container ) error {
0 commit comments