elastic / elastic-agent

Elastic Agent - single, unified way to add monitoring for logs, metrics, and other types of data to a host.
Other
125 stars 134 forks source link

[Integration Test Framework] Dump process list on first failure #4935

Closed ycombinator closed 2 months ago

ycombinator commented 3 months ago

Currently, when an integration test fails, we dump the process list to help debug the failure, by registering a t.Cleanup() callback: https://github.com/elastic/elastic-agent/blob/e8962b0e4857f1e66d5b4887b4c8fcbb4f1e8af0/pkg/testing/fixture_install.go#L219-L226

However, this callback registration is happening after the test attempts to install Elastic Agent: https://github.com/elastic/elastic-agent/blob/e8962b0e4857f1e66d5b4887b4c8fcbb4f1e8af0/pkg/testing/fixture_install.go#L180-L194

Consequently, if the install itself fails, we do not get a dump of the process list.

We should make it so the process list is dumped on the earliest failure of any integration test.

elasticmachine commented 3 months ago

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)