in fixtures.go [106:126]
func (t *TestWorkflow) waitForQuotaStep(qa *daisy.QuotaAvailable, stepname string) error {
step, ok := t.wf.Steps[stepname]
if !ok {
var err error
step, err = t.wf.NewStep(stepname)
if err != nil {
return err
}
step.WaitForAvailableQuotas = &daisy.WaitForAvailableQuotas{Interval: "90s"}
}
// If the step is already waiting for this quota, add the number of units to
// the existing quota.
for _, q := range step.WaitForAvailableQuotas.Quotas {
if q.Metric == qa.Metric && q.Region == qa.Region {
q.Units = q.Units + qa.Units
return nil
}
}
step.WaitForAvailableQuotas.Quotas = append(step.WaitForAvailableQuotas.Quotas, qa)
return nil
}