NO-JIRA: fix flaky TestReconcile/machine_with_node_likely_to_go_unhealthy#1483#1483
Conversation
…kely_to_go_unhealthy The test set LastTransitionTime = time.Now() once at TestReconcile init, then ran four other test cases before the timing-sensitive one. If those cases took >2s total, durationUnhealthy exceeded the ±1s tolerance window and the test failed intermittently. Fix by resetting LastTransitionTime immediately before buildRunTimeObjects is called for that specific test case, ensuring durationUnhealthy ≈ 0 at reconcile time.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe test file for the machine health check controller has been extended with a per-test setup hook mechanism. A new optional Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.11.3)Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions Comment Tip CodeRabbit can use Trivy to scan for security misconfigurations and secrets in Infrastructure as Code files.Add a .trivyignore file to your project to customize which findings Trivy reports. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nrb 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 |
|
@RadekManak: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/retitle NO-JIRA: fix flaky TestReconcile/machine_with_node_likely_to_go_unhealthy#1483 |
|
@RadekManak: This pull request explicitly references no jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/verified by passing units in CI |
|
@nrb: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
The test set LastTransitionTime = time.Now() once at TestReconcile init, then ran four other test cases before the timing-sensitive one. If those cases took >2s total, durationUnhealthy exceeded the ±1s tolerance window and the test failed intermittently.
Fix by resetting LastTransitionTime immediately before buildRunTimeObjects is called for that specific test case, ensuring durationUnhealthy ≈ 0 at reconcile time.