Skip to content

ARO-26564: fix: include condition name in provisioning timeout errors#4841

Merged
ventifus merged 1 commit into
masterfrom
ARO-26564/improve-timeout-error-reporting
May 21, 2026
Merged

ARO-26564: fix: include condition name in provisioning timeout errors#4841
ventifus merged 1 commit into
masterfrom
ARO-26564/improve-timeout-error-reporting

Conversation

@nikhil-thomas
Copy link
Copy Markdown
Collaborator

@nikhil-thomas nikhil-thomas commented May 19, 2026

Which issue this PR addresses: ARO-26564

Fixes https://redhat.atlassian.net/browse/ARO-26564

Fixes

What this PR does / why we need it:

When a condition step times out and is not in the
timeoutConditionErrors map, the error returned was the raw
"timed out waiting for the condition" with no indication of
which condition failed.

  • Wrap the original error with the condition function name in
    enrichConditionTimeoutError() when the function is not found
    in the timeoutConditionErrors map
    var timeoutConditionErrors = map[string]string{
  • Use fmt.Errorf("condition step failed: %s: %w", ...) rather
    than fmt.Errorf("timed out waiting for condition %s", ...)
    because using a distinct prefix avoids the redundant output of
    timed out waiting for condition X: timed out waiting for the condition
  • Update unit and integration tests to match the new error format

Test plan for issue:

How did you test that this PR works?

  • Are there unit tests? - i have run the unit tests.

Is there any documentation that needs to be updated for this PR?

How do you know this will function as expected in production?

Copy link
Copy Markdown
Collaborator

@iormungand iormungand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Confirmed all Conditions in install.go are now covered
  • Good error messages
  • Added better information for any future Conditions missing from timeoutConditionErrors map
  • Tests all run

LGTM

@iormungand
Copy link
Copy Markdown
Collaborator

Looks like perhaps this ticket is asking for the wrong thing:
https://redhat-internal.slack.com/archives/C02ULBRS68M/p1779247378561709

These errors are not actionable by the user - incorrect configuration should be caught by preflight, rather than once they have timed out. Surfacing details could make the problem worse if they try to use an LLM.

Looks like we really just need to write a log line, and put comments in the code to document the exception being made.

@nikhil-thomas
Copy link
Copy Markdown
Collaborator Author

/help

When a condition step times out and is not in the
timeoutConditionErrors map, the error returned was the raw
"timed out waiting for the condition" with no indication of
which condition failed.

- Wrap the original error with the condition function name in
  enrichConditionTimeoutError() when the function is not found
  in the timeoutConditionErrors map https://github.com/Azure/ARO-RP/blob/fc8e2af90c55d096f6f0db89892d1e543925b4f6/pkg/util/steps/condition.go#L26
- Use `fmt.Errorf("condition step failed: %s: %w", ...)` rather
  than `fmt.Errorf("timed out waiting for condition %s", ...)`
  because using a distinct prefix avoids the redundant output of
  `timed out waiting for condition X: timed out waiting for the
  condition`
- Update unit and integration tests to match the new error format

Signed-off-by: Nikhil Thomas <nikthoma@redhat.com>
@nikhil-thomas nikhil-thomas force-pushed the ARO-26564/improve-timeout-error-reporting branch from 55e8ddf to 1dce17b Compare May 20, 2026 21:32
Copy link
Copy Markdown
Collaborator

@ventifus ventifus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ventifus ventifus merged commit e68f959 into master May 21, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants