Skip to content

Commit 7976461

Browse files
pkoutsovasilismergify[bot]
authored andcommitted
[flakiness] Correct group for TestEndpointAgentServiceMonitoring (#7165)
* fix: move TestEndpointAgentServiceMonitoring under FleetEndpointSecurity execution group * fix: specify full endpoint path in pgrep and pkill of TestEndpointMetricsAfterRestart (cherry picked from commit 31aac31)
1 parent 69b367a commit 7976461

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

testing/integration/monitoring_endpoint_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type EndpointMetricsMonRunner struct {
3434

3535
func TestEndpointAgentServiceMonitoring(t *testing.T) {
3636
info := define.Require(t, define.Requirements{
37-
Group: Fleet,
37+
Group: FleetEndpointSecurity,
3838
Stack: &define.Stack{},
3939
Local: false, // requires Agent installation
4040
Sudo: true, // requires Agent installation
@@ -135,18 +135,19 @@ func (runner *EndpointMetricsMonRunner) TestEndpointMetricsAfterRestart() {
135135
}
136136

137137
// kill endpoint
138-
cmd := exec.Command("pgrep", "-f", "endpoint")
138+
cmd := exec.Command("pgrep", "-f", "/opt/Elastic/Endpoint/elastic-endpoint")
139139
pgrep, err := cmd.CombinedOutput()
140+
require.NoError(runner.T(), err)
140141
runner.T().Logf("killing pid: %s", string(pgrep))
141142

142-
cmd = exec.Command("pkill", "--signal", "SIGKILL", "-f", "endpoint")
143+
cmd = exec.Command("pkill", "--signal", "SIGKILL", "-f", "/opt/Elastic/Endpoint/elastic-endpoint")
143144
_, err = cmd.CombinedOutput()
144145
require.NoError(runner.T(), err)
145146

146147
// wait for endpoint to come back up. We use `pgrep`
147148
// since the agent health status won't imidately register that the endpoint process itself is gone.
148149
require.Eventually(runner.T(), func() bool {
149-
cmd := exec.Command("pgrep", "-f", "endpoint")
150+
cmd := exec.Command("pgrep", "-f", "/opt/Elastic/Endpoint/elastic-endpoint")
150151
pgrep, err := cmd.CombinedOutput()
151152
runner.T().Logf("found pid: %s", string(pgrep))
152153
if err == nil {

0 commit comments

Comments
 (0)