GoogleCloudPlatform / prometheus-engine

Google Cloud Managed Service for Prometheus libraries and manifests.
https://g.co/cloud/managedprometheus
Apache License 2.0
195 stars 93 forks source link

test(e2e): debug pod logs #976

Closed TheSpiritXIII closed 5 months ago

TheSpiritXIII commented 5 months ago

Show debug Prometheus collector logs when an e2e test fails to startup.

I was running into an issue that only happened on GitHub Actions. How this works:

  1. Use a context that times out right before the test. This ensures the test catches the timeout and can "cleanup" or in this case, show logs before exiting.
  2. Show debug logs in the test. We use a new context in case the test timed out, and the original context cannot be reused.