(t *testing.T)
| 476 | } |
| 477 | |
| 478 | func TestShouldStartContainersInParallel(t *testing.T) { |
| 479 | ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute) |
| 480 | t.Cleanup(cancel) |
| 481 | |
| 482 | for i := range 3 { |
| 483 | i := i |
| 484 | t.Run(fmt.Sprintf("iteration_%d", i), func(t *testing.T) { |
| 485 | t.Parallel() |
| 486 | |
| 487 | ctr, err := testcontainers.Run( |
| 488 | ctx, nginxAlpineImage, |
| 489 | testcontainers.WithExposedPorts(nginxDefaultPort), |
| 490 | testcontainers.WithWaitStrategy(wait.ForHTTP("/").WithStartupTimeout(10*time.Second)), |
| 491 | ) |
| 492 | testcontainers.CleanupContainer(t, ctr) |
| 493 | require.NoError(t, err) |
| 494 | |
| 495 | // mappedPort { |
| 496 | port, err := ctr.MappedPort(ctx, nginxDefaultPort) |
| 497 | // } |
| 498 | require.NoError(t, err) |
| 499 | |
| 500 | t.Logf("Parallel container [iteration_%d] listening on %d\n", i, port.Num()) |
| 501 | }) |
| 502 | } |
| 503 | } |
| 504 | |
| 505 | func ExampleGenericContainer_withSubstitutors() { |
| 506 | ctx := context.Background() |
nothing calls this directly
no test coverage detected
searching dependent graphs…