Add logging improvements to AGENTS.md#4825
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the E2E testing guidelines in test/AGENTS.md to reduce noisy logs in polling-style tests by recommending delta-only, expectation-focused logging patterns.
Changes:
- Add a new “Logging in Eventually/Polling Tests” section with guidance for delta-only logging and actionable failure output.
- Reference the existing
eventuallyVerifyhelper as a baseline pattern for polling verifications.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| 4. **Consider dumping targeted state on failure:** When a polling loop times out, it is strongly recommended to dump the status of the specific resources you were directly polling — e.g. if you were waiting for Machines to upgrade, dump those Machine statuses. Keep this narrowly scoped to avoid log clutter; broad cluster diagnostics should be left to `oc adm inspect` or equivalent artifact collection. The goal is that the most immediately relevant context appears inline next to the failure message. | ||
|
|
||
| 5. **Use `eventuallyVerify` or equivalent patterns:** The `eventuallyVerify` helper in `e2e/cluster_pullsecret.go` implements delta-only logging by tracking the previous error string. This pattern (based on HyperShift's `EventuallyObject` in [test/e2e/util/eventually.go](https://github.com/openshift/hypershift/blob/main/test/e2e/util/eventually.go)) should be used as the baseline for all polling-style verifications. Consider also logging a timestamp for when the `eventuallyVerify` or similar polling operation completes successfully if the verifier you are using does not already implement this function. |
There was a problem hiding this comment.
The reference to eventuallyVerify points to e2e/cluster_pullsecret.go, but the file lives under test/e2e/cluster_pullsecret.go (and elsewhere in this doc you use test/e2e/...). Consider updating the path for consistency and to make the link/location unambiguous.
| 5. **Use `eventuallyVerify` or equivalent patterns:** The `eventuallyVerify` helper in `e2e/cluster_pullsecret.go` implements delta-only logging by tracking the previous error string. This pattern (based on HyperShift's `EventuallyObject` in [test/e2e/util/eventually.go](https://github.com/openshift/hypershift/blob/main/test/e2e/util/eventually.go)) should be used as the baseline for all polling-style verifications. Consider also logging a timestamp for when the `eventuallyVerify` or similar polling operation completes successfully if the verifier you are using does not already implement this function. | |
| 5. **Use `eventuallyVerify` or equivalent patterns:** The `eventuallyVerify` helper in `test/e2e/cluster_pullsecret.go` implements delta-only logging by tracking the previous error string. This pattern (based on HyperShift's `EventuallyObject` in [test/e2e/util/eventually.go](https://github.com/openshift/hypershift/blob/main/test/e2e/util/eventually.go)) should be used as the baseline for all polling-style verifications. Consider also logging a timestamp for when the `eventuallyVerify` or similar polling operation completes successfully if the verifier you are using does not already implement this function. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mgahagan73, raelga The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What
Add recently logging improvement suggestions to AGENTS.md
Why
Reduce log clutter by improving logging hygene and implementing a delta logging model.