Skip to content

Commit

Permalink
remove container reuse check
Browse files Browse the repository at this point in the history
  • Loading branch information
prongq committed Oct 29, 2023
1 parent e4c5d1d commit c941f6e
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions generic_test.go
Expand Up @@ -3,12 +3,11 @@ package testcontainers
import (
"context"
"errors"
"fmt"
"io"
"net/http"
"os"
stdexec "os/exec"
"regexp"
"strings"
"sync"
"testing"

Expand Down Expand Up @@ -145,9 +144,6 @@ func TestWithStartupCommand(t *testing.T) {
}

func TestGenericReusableContainerInSubprocess(t *testing.T) {
containerIDOnce := sync.Once{}
containerID := ""

wg := sync.WaitGroup{}
wg.Add(10)
for i := 0; i < 10; i++ {
Expand All @@ -157,17 +153,9 @@ func TestGenericReusableContainerInSubprocess(t *testing.T) {
// create containers in subprocesses, as "go test ./..." does.
output := createReuseContainerInSubprocess(t)

// check is container reused.
re := regexp.MustCompile(fmt.Sprintf("%s(.*)%s",
"🚧 Waiting for container id ",
regexp.QuoteMeta(fmt.Sprintf(" image: %s", nginxDelayedImage)),
))
match := re.FindStringSubmatch(output)

containerIDOnce.Do(func() {
containerID = match[1]
})
require.Equal(t, containerID, match[1])
// check is reuse container with WaitingFor work correctly.
contains := strings.Contains(output, "🚧 Waiting for container id")
require.True(t, contains)
}()
}

Expand Down

0 comments on commit c941f6e

Please sign in to comment.