Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

Commit f11ef39

Browse files
committed
Add timeout safeguard to elastic-agent execution
In some cases such as attempting to re-enroll with a revoked token, the elastic-agent will retry indefinitely. This fix adds a safeguard utilizing 'timeout' command prepended to the elastic-agent command so that it will timeout after TimeoutFactor Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
1 parent 3b5a727 commit f11ef39

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

internal/installer/elasticagent.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package installer
66

77
import (
88
"context"
9+
"fmt"
910

1011
"github.com/elastic/e2e-testing/internal/common"
1112
"github.com/elastic/e2e-testing/internal/compose"
@@ -63,7 +64,7 @@ func (i *ElasticAgentInstaller) ListElasticAgentWorkingDirContent(containerName
6364
// runElasticAgentCommandEnv runs a command for the elastic-agent
6465
func runElasticAgentCommandEnv(profile string, image string, service string, process string, command string, arguments []string, env map[string]string) error {
6566
cmds := []string{
66-
process, command,
67+
"timeout", fmt.Sprintf("%dm", common.TimeoutFactor), process, command,
6768
}
6869
cmds = append(cmds, arguments...)
6970

0 commit comments

Comments
 (0)