Closed ycombinator closed 2 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
t.Cleanup()
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.
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)
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-L226However, 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.