diff --git a/managed/cmd/pmm-managed-starlark/main_test.go b/managed/cmd/pmm-managed-starlark/main_test.go index f52f76ce86..fcabbb8f0a 100644 --- a/managed/cmd/pmm-managed-starlark/main_test.go +++ b/managed/cmd/pmm-managed-starlark/main_test.go @@ -17,10 +17,12 @@ package main import ( "bytes" + "context" "encoding/json" "os" "os/exec" "testing" + "time" "github.com/percona-platform/saas/pkg/check" "github.com/stretchr/testify/assert" @@ -103,8 +105,12 @@ func TestStarlarkSandbox(t *testing.T) { //nolint:tparallel }, } + ctx, _ := context.WithTimeout(context.Background(), 120*time.Second) // since we run the binary as a child process to test it we need to build it first. - err := exec.Command("make", "-C", "../..", "release").Run() + command := exec.CommandContext(ctx, "make", "-C", "../..", "release") + command.Stdout = os.Stdout + command.Stderr = os.Stderr + err := command.Run() require.NoError(t, err) for _, tc := range testCases { diff --git a/managed/services/agents/deps.go b/managed/services/agents/deps.go index 14ab6d6b49..e164663985 100644 --- a/managed/services/agents/deps.go +++ b/managed/services/agents/deps.go @@ -23,7 +23,6 @@ import ( "github.com/percona/pmm/api/agentpb" qanpb "github.com/percona/pmm/api/qanpb" - "github.com/percona/pmm/managed/services/agents/channel" ) // prometheusService is a subset of methods of victoriametrics.Service used by this package. @@ -69,11 +68,3 @@ type highAvailablityService interface { // TODO: extend by send message BroadcastMessage(message []byte) } - -type communicationChannel interface { - Requests() <-chan *channel.AgentRequest - Send(resp *channel.ServerResponse) - SendAndWaitResponse(payload agentpb.ServerRequestPayload) (agentpb.AgentResponsePayload, error) - Metrics() *channel.Metrics - Wait() error -} diff --git a/managed/services/agents/registry.go b/managed/services/agents/registry.go index b3ca08631f..523e1eb996 100644 --- a/managed/services/agents/registry.go +++ b/managed/services/agents/registry.go @@ -78,7 +78,7 @@ type localPMMAgentInfo struct { kickChan chan struct{} } -func (p *localPMMAgentInfo) Channel() *channel.Channel { //nolint:ireturn +func (p *localPMMAgentInfo) Channel() *channel.Channel { return p.channel } diff --git a/managed/testdata/supervisord.d/pmm-db_disabled.ini b/managed/testdata/supervisord.d/pmm-db_disabled.ini index b45251ab1f..8e1cb82648 100644 --- a/managed/testdata/supervisord.d/pmm-db_disabled.ini +++ b/managed/testdata/supervisord.d/pmm-db_disabled.ini @@ -77,7 +77,7 @@ redirect_stderr = true priority = 15 command = /usr/sbin/pmm-agent --config-file=/usr/local/percona/pmm2/config/pmm-agent.yaml autorestart = true -autostart = true +autostart = false startretries = 1000 startsecs = 1 stopsignal = TERM diff --git a/managed/testdata/supervisord.d/pmm-db_enabled.ini b/managed/testdata/supervisord.d/pmm-db_enabled.ini index 4d4ad4afd9..4ce13c4281 100644 --- a/managed/testdata/supervisord.d/pmm-db_enabled.ini +++ b/managed/testdata/supervisord.d/pmm-db_enabled.ini @@ -101,7 +101,7 @@ redirect_stderr = true priority = 15 command = /usr/sbin/pmm-agent --config-file=/usr/local/percona/pmm2/config/pmm-agent.yaml autorestart = true -autostart = true +autostart = false startretries = 1000 startsecs = 1 stopsignal = TERM