Skip to content

Commit 02c4118

Browse files
Re-enable resource leak tests, change timeout, improve message (#4454)
* enable test, change timeout, error message * change id name * fix syntax * try to make the unit IDs more generic --------- Co-authored-by: Pierre HILBERT <pierre.hilbert@elastic.co>
1 parent fc67134 commit 02c4118

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

.buildkite/pipeline.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -223,15 +223,15 @@ steps:
223223
provider: "gcp"
224224
machineType: "n1-standard-8"
225225

226-
# - label: "Extended runtime leak tests"
227-
# key: "extended-integration-tests"
228-
# command: ".buildkite/scripts/steps/integration_tests.sh stateful integration:TestForResourceLeaks"
229-
# artifact_paths:
230-
# - "build/TEST-**"
231-
# - "build/diagnostics/*"
232-
# agents:
233-
# provider: "gcp"
234-
# machineType: "n1-standard-8"
226+
- label: "Extended runtime leak tests"
227+
key: "extended-integration-tests"
228+
command: ".buildkite/scripts/steps/integration_tests.sh stateful integration:TestForResourceLeaks"
229+
artifact_paths:
230+
- "build/TEST-**"
231+
- "build/diagnostics/*"
232+
agents:
233+
provider: "gcp"
234+
machineType: "n1-standard-8"
235235

236236
- label: "Integration tests"
237237
key: "integration-tests"

testing/integration/agent_long_running_leak_test.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func TestLongRunningAgentForLeaks(t *testing.T) {
7878
}
7979

8080
suite.Run(t, &ExtendedRunner{info: info,
81-
healthCheckTime: time.Minute * 3,
81+
healthCheckTime: time.Minute * 6,
8282
healthCheckRefreshTime: time.Second * 20,
8383
resourceWatchers: []StatusWatcher{ // select which tests to run
8484
&handleMonitor{},
@@ -229,13 +229,14 @@ func (runner *ExtendedRunner) TestHandleLeak() {
229229
// CheckHealthAtStartup ensures all the beats and agent are healthy and working before we continue
230230
func (runner *ExtendedRunner) CheckHealthAtStartup(ctx context.Context) {
231231
// because we need to separately fetch the PIDs, wait until everything is healthy before we look for running beats
232+
compDebugName := ""
232233
require.Eventually(runner.T(), func() bool {
233234
allHealthy := true
234235
status, err := runner.agentFixture.ExecStatus(ctx)
235236

236237
apacheMatch := "logfile-apache"
237238
foundApache := false
238-
systemMatch := "metrics-default"
239+
systemMatch := "system/metrics"
239240
foundSystem := false
240241

241242
require.NoError(runner.T(), err)
@@ -253,11 +254,12 @@ func (runner *ExtendedRunner) CheckHealthAtStartup(ctx context.Context) {
253254
}
254255
runner.T().Logf("component state: %s", comp.Message)
255256
if comp.State != int(cproto.State_HEALTHY) {
257+
compDebugName = comp.Name
256258
allHealthy = false
257259
}
258260
}
259261
return allHealthy && foundApache && foundSystem
260-
}, runner.healthCheckTime, runner.healthCheckRefreshTime, "install never became healthy")
262+
}, runner.healthCheckTime, runner.healthCheckRefreshTime, "install never became healthy: components did not return a healthy state: %s", compDebugName)
261263
}
262264

263265
/*

0 commit comments

Comments
 (0)