Skip to content

Improve Debuggability in UTs of Trial Controller #2431

@Electronic-Waste

Description

@Electronic-Waste

What you would like to be added?

Use the propagated gomega instance in replace of func() bool, like code here:

// Expect that Trial status is succeeded with "false" status and "metrics unavailable" reason.
// Metrics unavailable because GetTrialObservationLog returns "unavailable".
g.Eventually(func() bool {
if err = c.Get(ctx, trialKey, trial); err != nil {
return false
}
return trial.IsMetricsUnavailable() &&
len(trial.Status.Observation.Metrics) > 0 &&
trial.Status.Observation.Metrics[0].Min == consts.UnavailableMetricValue &&
trial.Status.Observation.Metrics[0].Max == consts.UnavailableMetricValue &&
trial.Status.Observation.Metrics[0].Latest == consts.UnavailableMetricValue
}, timeout).Should(gomega.BeTrue())

Why is this needed?

As @tenzen-y described in #2394 (comment), it will improve the debuggability of the UTs.

Love this feature?

Give it a 👍 We prioritize the features with most 👍

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions