From ede69b1a6fca2148dc5df3a496584dc1ed4dd6c7 Mon Sep 17 00:00:00 2001 From: Valeri Pliskin Date: Fri, 29 Nov 2024 12:18:02 +0000 Subject: [PATCH 1/6] getting PatternScanner from the caller refactored baseConfig creation into a helper method --- pkg/util/testutil/docker/config.go | 53 +++++++++++++++--------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/pkg/util/testutil/docker/config.go b/pkg/util/testutil/docker/config.go index c7b34281a979e..ed59ffaea7d71 100644 --- a/pkg/util/testutil/docker/config.go +++ b/pkg/util/testutil/docker/config.go @@ -9,8 +9,9 @@ package docker import ( "fmt" - "regexp" "time" + + "github.com/DataDog/datadog-agent/pkg/util/testutil" ) const ( @@ -49,7 +50,7 @@ var _ LifecycleConfig = (*composeConfig)(nil) type LifecycleConfig interface { Timeout() time.Duration Retries() int - LogPattern() *regexp.Regexp + PatternScanner() *testutil.PatternScanner Env() []string Name() string command() string @@ -66,9 +67,9 @@ func (b baseConfig) Retries() int { return b.retries } -// LogPattern returns the regex pattern to match logs for readiness -func (b baseConfig) LogPattern() *regexp.Regexp { - return b.logPattern +// PatternScanner returns the patternScanner object used to match logs for readiness and completion of the target container/s +func (b baseConfig) PatternScanner() *testutil.PatternScanner { + return b.patternScanner } // Env returns the environment variables to set for the container/s @@ -83,11 +84,11 @@ func (b baseConfig) Name() string { // baseConfig contains shared configurations for both Docker and Docker Compose. type baseConfig struct { - name string // Container name for docker or an alias for docker-compose - timeout time.Duration // Timeout for the entire operation. - retries int // Number of retries for starting. - logPattern *regexp.Regexp // Regex pattern to match logs for readiness. - env []string // Environment variables to set. + name string // Container name for docker or an alias for docker-compose + timeout time.Duration // Timeout for the entire operation. + retries int // Number of retries for starting. + patternScanner *testutil.PatternScanner // Regex pattern to match logs for readiness. + env []string // Environment variables to set. } // runConfig contains specific configurations for Docker containers, embedding BaseConfig. @@ -153,16 +154,20 @@ func (c composeConfig) commandArgs(t subCommandType) []string { } } +func createBaseConfig(name string, timeout time.Duration, retries int, patternScanner *testutil.PatternScanner, env []string) baseConfig { + return baseConfig{ + name: name, + timeout: timeout, + retries: retries, + patternScanner: patternScanner, + env: env, + } +} + // NewRunConfig creates a new runConfig instance for a single docker container. -func NewRunConfig(name string, timeout time.Duration, retries int, logPattern *regexp.Regexp, env []string, imageName, binary string, binaryArgs []string, mounts map[string]string) LifecycleConfig { +func NewRunConfig(name string, timeout time.Duration, retries int, patternScanner *testutil.PatternScanner, env []string, imageName, binary string, binaryArgs []string, mounts map[string]string) LifecycleConfig { return runConfig{ - baseConfig: baseConfig{ - timeout: timeout, - retries: retries, - logPattern: logPattern, - env: env, - name: name, - }, + baseConfig: createBaseConfig(name, timeout, retries, patternScanner, env), ImageName: imageName, Binary: binary, BinaryArgs: binaryArgs, @@ -171,15 +176,9 @@ func NewRunConfig(name string, timeout time.Duration, retries int, logPattern *r } // NewComposeConfig creates a new composeConfig instance for the docker-compose. -func NewComposeConfig(name string, timeout time.Duration, retries int, logPattern *regexp.Regexp, env []string, file string) LifecycleConfig { +func NewComposeConfig(name string, timeout time.Duration, retries int, patternScanner *testutil.PatternScanner, env []string, file string) LifecycleConfig { return composeConfig{ - baseConfig: baseConfig{ - timeout: timeout, - retries: retries, - logPattern: logPattern, - env: env, - name: name, - }, - File: file, + baseConfig: createBaseConfig(name, timeout, retries, patternScanner, env), + File: file, } } From fcd69e540369b26c5e92d027accdc2040be442fc Mon Sep 17 00:00:00 2001 From: Valeri Pliskin Date: Fri, 29 Nov 2024 12:19:34 +0000 Subject: [PATCH 2/6] encapsulated chan creation inside patternScanner ctor --- pkg/util/testutil/patternscanner.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/util/testutil/patternscanner.go b/pkg/util/testutil/patternscanner.go index 0610ad30afd72..06dc357466033 100644 --- a/pkg/util/testutil/patternscanner.go +++ b/pkg/util/testutil/patternscanner.go @@ -43,14 +43,14 @@ type PatternScanner struct { // NewScanner returns a new instance of PatternScanner. // at least one of the startPattern/finishPattern should be provided. -func NewScanner(startPattern, finishPattern *regexp.Regexp, doneChan chan struct{}) (*PatternScanner, error) { +func NewScanner(startPattern, finishPattern *regexp.Regexp) (*PatternScanner, error) { if startPattern == nil && finishPattern == nil { return nil, errors.New("at least one pattern should be provided") } return &PatternScanner{ startPattern: startPattern, finishPattern: finishPattern, - DoneChan: doneChan, + DoneChan: make(chan struct{}, 1), stopOnce: sync.Once{}, // skip looking for start pattern if not provided startPatternFound: startPattern == nil, From 79b495785bc2877764e97cc6297b620e35e1bcd3 Mon Sep 17 00:00:00 2001 From: Valeri Pliskin Date: Fri, 29 Nov 2024 12:20:27 +0000 Subject: [PATCH 3/6] removed patternScanner creation and changed to use the config field --- pkg/util/testutil/docker/run.go | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/pkg/util/testutil/docker/run.go b/pkg/util/testutil/docker/run.go index acde40acd969c..c92bb8484ae4e 100644 --- a/pkg/util/testutil/docker/run.go +++ b/pkg/util/testutil/docker/run.go @@ -13,10 +13,6 @@ import ( "os/exec" "testing" "time" - - "github.com/stretchr/testify/require" - - "github.com/DataDog/datadog-agent/pkg/util/testutil" ) // Run starts the container/s and ensures their successful invocation @@ -26,17 +22,13 @@ import ( func Run(t testing.TB, cfg LifecycleConfig) error { var err error var ctx context.Context - var scanner *testutil.PatternScanner for i := 0; i < cfg.Retries(); i++ { t.Helper() // Ensuring no previous instances exists. killPreviousInstances(cfg) - //TODO: in the following PR move the scanner to be a field of the LifecycleConfig - scanner, err = testutil.NewScanner(cfg.LogPattern(), testutil.NoPattern, make(chan struct{}, 1)) - require.NoError(t, err, "failed to create pattern scanner") // attempt to start the container/s - ctx, err = run(t, cfg, scanner) + ctx, err = run(t, cfg) if err != nil { t.Logf("could not start %s: %v", cfg.Name(), err) //this iteration failed, retry @@ -44,13 +36,13 @@ func Run(t testing.TB, cfg LifecycleConfig) error { } //check container logs for successful start - if err = checkReadiness(ctx, cfg, scanner); err == nil { + if err = checkReadiness(ctx, cfg); err == nil { // target container/s started successfully, we can stop the retries loop and finish here t.Logf("%s command succeeded. %s container is running", cfg.command(), cfg.Name()) return nil } t.Logf("[Attempt #%v] failed to start %s server: %v", i+1, cfg.Name(), err) - scanner.PrintLogs(t) + cfg.PatternScanner().PrintLogs(t) time.Sleep(5 * time.Second) } return err @@ -71,7 +63,7 @@ func killPreviousInstances(cfg LifecycleConfig) { _ = c.Run() } -func run(t testing.TB, cfg LifecycleConfig, scanner *testutil.PatternScanner) (context.Context, error) { +func run(t testing.TB, cfg LifecycleConfig) (context.Context, error) { ctx, cancel := context.WithCancel(context.Background()) t.Cleanup(cancel) @@ -80,8 +72,8 @@ func run(t testing.TB, cfg LifecycleConfig, scanner *testutil.PatternScanner) (c //prepare the command cmd := exec.CommandContext(ctx, cfg.command(), args...) cmd.Env = append(cmd.Env, cfg.Env()...) - cmd.Stdout = scanner - cmd.Stderr = scanner + cmd.Stdout = cfg.PatternScanner() + cmd.Stderr = cfg.PatternScanner() // run asynchronously and don't wait for the command to finish if err := cmd.Start(); err != nil { @@ -97,14 +89,14 @@ func run(t testing.TB, cfg LifecycleConfig, scanner *testutil.PatternScanner) (c return ctx, nil } -func checkReadiness(ctx context.Context, cfg LifecycleConfig, scanner *testutil.PatternScanner) error { +func checkReadiness(ctx context.Context, cfg LifecycleConfig) error { for { select { case <-ctx.Done(): if err := ctx.Err(); err != nil { return fmt.Errorf("failed to start the container %s due to: %w", cfg.Name(), err) } - case <-scanner.DoneChan: + case <-cfg.PatternScanner().DoneChan: return nil case <-time.After(cfg.Timeout()): return fmt.Errorf("failed to start the container %s, reached timeout of %v", cfg.Name(), cfg.Timeout()) From aabc312af49553c9b2e0192fa31c87b286f875ca Mon Sep 17 00:00:00 2001 From: Valeri Pliskin Date: Fri, 29 Nov 2024 12:21:19 +0000 Subject: [PATCH 4/6] adjustment to NewScanner signature changes --- pkg/network/usm/sharedlibraries/testutil/testutil.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/network/usm/sharedlibraries/testutil/testutil.go b/pkg/network/usm/sharedlibraries/testutil/testutil.go index a5f36ab69c216..ff10b58e7367d 100644 --- a/pkg/network/usm/sharedlibraries/testutil/testutil.go +++ b/pkg/network/usm/sharedlibraries/testutil/testutil.go @@ -31,7 +31,7 @@ var mux sync.Mutex // handle to the given paths. func OpenFromProcess(t *testing.T, programExecutable string, paths ...string) (*exec.Cmd, error) { cmd := exec.Command(programExecutable, paths...) - patternScanner, err := protocolstestutil.NewScanner(regexp.MustCompile("awaiting signal"), protocolstestutil.NoPattern, make(chan struct{}, 1)) + patternScanner, err := protocolstestutil.NewScanner(regexp.MustCompile("awaiting signal"), protocolstestutil.NoPattern) require.NoError(t, err, "failed to create pattern scanner") cmd.Stdout = patternScanner cmd.Stderr = patternScanner From f494ee0c0dfd9672854bcb917690d4492bb58121 Mon Sep 17 00:00:00 2001 From: Valeri Pliskin Date: Fri, 29 Nov 2024 12:21:46 +0000 Subject: [PATCH 5/6] creating PatternScanner and passing it to the Docker-Compose Config --- .../corechecks/servicediscovery/module/impl_linux_test.go | 7 +++++-- pkg/network/protocols/amqp/server.go | 5 ++++- pkg/network/protocols/kafka/server.go | 6 +++++- pkg/network/protocols/mongo/server.go | 6 +++++- pkg/network/protocols/mysql/server.go | 5 ++++- pkg/network/protocols/postgres/server.go | 6 +++++- pkg/network/protocols/redis/server.go | 5 ++++- pkg/network/protocols/tls/gotls/testutil/server.go | 6 +++++- pkg/network/protocols/tls/nodejs/nodejs.go | 6 +++++- pkg/network/usm/monitor_tls_test.go | 5 ++++- 10 files changed, 46 insertions(+), 11 deletions(-) diff --git a/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go b/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go index 822e08866a0a1..d99063dfac193 100644 --- a/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go +++ b/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go @@ -56,6 +56,7 @@ import ( proccontainersmocks "github.com/DataDog/datadog-agent/pkg/process/util/containers/mocks" "github.com/DataDog/datadog-agent/pkg/util/fxutil" "github.com/DataDog/datadog-agent/pkg/util/kernel" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" dockerutils "github.com/DataDog/datadog-agent/pkg/util/testutil/docker" ) @@ -795,13 +796,15 @@ func TestDocker(t *testing.T) { url, mockContainerProvider := setupDiscoveryModule(t) dir, _ := testutil.CurDir() + scanner, err := globalutils.NewScanner(regexp.MustCompile("Serving.*"), globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("foo-server", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - regexp.MustCompile("Serving.*"), + scanner, dockerutils.EmptyEnv, filepath.Join(dir, "testdata", "docker-compose.yml")) - err := dockerutils.Run(t, dockerCfg) + err = dockerutils.Run(t, dockerCfg) require.NoError(t, err) proc, err := procfs.NewDefaultFS() diff --git a/pkg/network/protocols/amqp/server.go b/pkg/network/protocols/amqp/server.go index b6d5e14338e4a..ffd049cb36667 100644 --- a/pkg/network/protocols/amqp/server.go +++ b/pkg/network/protocols/amqp/server.go @@ -7,6 +7,7 @@ package amqp import ( "fmt" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" "os" "path/filepath" "regexp" @@ -46,10 +47,12 @@ func RunServer(t testing.TB, serverAddr, serverPort string, enableTLS bool) erro dir, _ := httpUtils.CurDir() + scanner, err := globalutils.NewScanner(startupRegexp, globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("amqp", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - startupRegexp, + scanner, env, filepath.Join(dir, "testdata", "docker-compose.yml")) return dockerutils.Run(t, dockerCfg) diff --git a/pkg/network/protocols/kafka/server.go b/pkg/network/protocols/kafka/server.go index b1d892d985814..95c66ef23b8a1 100644 --- a/pkg/network/protocols/kafka/server.go +++ b/pkg/network/protocols/kafka/server.go @@ -8,6 +8,8 @@ package kafka import ( + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" + "github.com/stretchr/testify/require" "os" "path/filepath" "regexp" @@ -40,10 +42,12 @@ func RunServer(t testing.TB, serverAddr, serverPort string) error { return err } + scanner, err := globalutils.NewScanner(regexp.MustCompile(`.*started \(kafka.server.KafkaServer\).*`), globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("kafka", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - regexp.MustCompile(`.*started \(kafka.server.KafkaServer\).*`), + scanner, env, filepath.Join(dir, "testdata", "docker-compose.yml")) return dockerutils.Run(t, dockerCfg) diff --git a/pkg/network/protocols/mongo/server.go b/pkg/network/protocols/mongo/server.go index 3abf2f69300a2..59717d099a9ae 100644 --- a/pkg/network/protocols/mongo/server.go +++ b/pkg/network/protocols/mongo/server.go @@ -7,6 +7,8 @@ package mongo import ( "fmt" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" + "github.com/stretchr/testify/require" "path/filepath" "regexp" "testing" @@ -31,10 +33,12 @@ func RunServer(t testing.TB, serverAddress, serverPort string) error { "MONGO_PASSWORD=" + Pass, } dir, _ := testutil.CurDir() + scanner, err := globalutils.NewScanner(regexp.MustCompile(fmt.Sprintf(".*Waiting for connections.*port.*:%s.*", serverPort)), globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("mongo", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - regexp.MustCompile(fmt.Sprintf(".*Waiting for connections.*port.*:%s.*", serverPort)), + scanner, env, filepath.Join(dir, "testdata", "docker-compose.yml")) return dockerutils.Run(t, dockerCfg) diff --git a/pkg/network/protocols/mysql/server.go b/pkg/network/protocols/mysql/server.go index 2ead1b2cbe9b5..1ea9ebb1ac1ec 100644 --- a/pkg/network/protocols/mysql/server.go +++ b/pkg/network/protocols/mysql/server.go @@ -7,6 +7,7 @@ package mysql import ( "fmt" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" "path/filepath" "regexp" "testing" @@ -45,10 +46,12 @@ func RunServer(t testing.TB, serverAddr, serverPort string, withTLS bool) error env = append(env, "MYSQL_TLS_ARGS=--require-secure-transport --ssl-cert=/mysql-test/cert.pem.0 --ssl-key=/mysql-test/server.key") } + scanner, err := globalutils.NewScanner(regexp.MustCompile(fmt.Sprintf(".*ready for connections.*port: %s.*", serverPort)), globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("MYSQL", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - regexp.MustCompile(fmt.Sprintf(".*ready for connections.*port: %s.*", serverPort)), + scanner, env, filepath.Join(dir, "testdata", "docker-compose.yml")) return dockerutils.Run(t, dockerCfg) diff --git a/pkg/network/protocols/postgres/server.go b/pkg/network/protocols/postgres/server.go index 8b95627347c16..2b4bd55bde9c6 100644 --- a/pkg/network/protocols/postgres/server.go +++ b/pkg/network/protocols/postgres/server.go @@ -10,6 +10,7 @@ package postgres import ( "fmt" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" "io" "os" "path/filepath" @@ -48,10 +49,13 @@ func RunServer(t testing.TB, serverAddr, serverPort string, enableTLS bool) erro "ENCRYPTION_MODE=" + encryptionMode, "TESTDIR=" + testDataDir, } + + scanner, err := globalutils.NewScanner(regexp.MustCompile(fmt.Sprintf(".*listening on IPv4 address \"0.0.0.0\", port %s", serverPort)), globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("postgres", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - regexp.MustCompile(fmt.Sprintf(".*listening on IPv4 address \"0.0.0.0\", port %s", serverPort)), + scanner, env, filepath.Join(testDataDir, "docker-compose.yml")) return dockerutils.Run(t, dockerCfg) diff --git a/pkg/network/protocols/redis/server.go b/pkg/network/protocols/redis/server.go index 4adf5191dc8bb..56d36fec8855c 100644 --- a/pkg/network/protocols/redis/server.go +++ b/pkg/network/protocols/redis/server.go @@ -11,6 +11,7 @@ package redis import ( "fmt" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" "path/filepath" "regexp" "testing" @@ -42,10 +43,12 @@ func RunServer(t testing.TB, serverAddr, serverPort string, enableTLS bool) erro env = append(env, args) } + scanner, err := globalutils.NewScanner(regexp.MustCompile(".*Ready to accept connections"), globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("redis", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - regexp.MustCompile(".*Ready to accept connections"), + scanner, env, filepath.Join(dir, "testdata", "docker-compose.yml")) return dockerutils.Run(t, dockerCfg) diff --git a/pkg/network/protocols/tls/gotls/testutil/server.go b/pkg/network/protocols/tls/gotls/testutil/server.go index 9ae6e47339709..36a58b003c0e6 100644 --- a/pkg/network/protocols/tls/gotls/testutil/server.go +++ b/pkg/network/protocols/tls/gotls/testutil/server.go @@ -6,6 +6,8 @@ package testutil import ( + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" + "github.com/stretchr/testify/require" "regexp" "testing" @@ -21,10 +23,12 @@ func RunServer(t testing.TB, serverPort string) error { t.Helper() dir, _ := testutil.CurDir() + scanner, err := globalutils.NewScanner(regexp.MustCompile("go-httpbin listening on https://0.0.0.0:8080"), globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("https-gotls", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - regexp.MustCompile("go-httpbin listening on https://0.0.0.0:8080"), + scanner, env, dir+"/../testdata/docker-compose.yml") return dockerutils.Run(t, dockerCfg) diff --git a/pkg/network/protocols/tls/nodejs/nodejs.go b/pkg/network/protocols/tls/nodejs/nodejs.go index c4b8b3682a25c..fb7dc18f60a9a 100644 --- a/pkg/network/protocols/tls/nodejs/nodejs.go +++ b/pkg/network/protocols/tls/nodejs/nodejs.go @@ -9,6 +9,8 @@ package nodejs import ( + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" + "github.com/stretchr/testify/require" "io" "os" "path" @@ -63,10 +65,12 @@ func RunServerNodeJS(t *testing.T, key, cert, serverPort string) error { "TESTDIR=" + dir + "/testdata", } + scanner, err := globalutils.NewScanner(regexp.MustCompile("Server running at https.*"), globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("nodejs-server", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - regexp.MustCompile("Server running at https.*"), + scanner, env, path.Join(dir, "testdata", "docker-compose.yml")) return dockerutils.Run(t, dockerCfg) diff --git a/pkg/network/usm/monitor_tls_test.go b/pkg/network/usm/monitor_tls_test.go index 4a609e0ac9a30..24f0f7b3a5d2f 100644 --- a/pkg/network/usm/monitor_tls_test.go +++ b/pkg/network/usm/monitor_tls_test.go @@ -12,6 +12,7 @@ import ( "bytes" "crypto/tls" "fmt" + globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" "io" "math/rand" nethttp "net/http" @@ -112,10 +113,12 @@ func (s *tlsSuite) TestHTTPSViaLibraryIntegration() { require.NoError(t, err) dir = path.Join(dir, "testdata", "musl") + scanner, err := globalutils.NewScanner(regexp.MustCompile("started"), globalutils.NoPattern) + require.NoError(t, err, "failed to create pattern scanner") dockerCfg := dockerutils.NewComposeConfig("musl-alpine", dockerutils.DefaultTimeout, dockerutils.DefaultRetries, - regexp.MustCompile("started"), + scanner, dockerutils.EmptyEnv, path.Join(dir, "/docker-compose.yml")) err = dockerutils.Run(t, dockerCfg) From 9d082d8d6e44580955e6db803e915903ba47475d Mon Sep 17 00:00:00 2001 From: Valeri Pliskin Date: Fri, 29 Nov 2024 12:36:20 +0000 Subject: [PATCH 6/6] updated documentation of the newly introduced field --- pkg/util/testutil/docker/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/util/testutil/docker/config.go b/pkg/util/testutil/docker/config.go index ed59ffaea7d71..d5f374afb79eb 100644 --- a/pkg/util/testutil/docker/config.go +++ b/pkg/util/testutil/docker/config.go @@ -87,7 +87,7 @@ type baseConfig struct { name string // Container name for docker or an alias for docker-compose timeout time.Duration // Timeout for the entire operation. retries int // Number of retries for starting. - patternScanner *testutil.PatternScanner // Regex pattern to match logs for readiness. + patternScanner *testutil.PatternScanner // Used to monitor container logs for known patterns. env []string // Environment variables to set. }