Skip to content

Commit

Permalink
Merge 1dad59b into blathers/backport-release-24.1-137843
Browse files Browse the repository at this point in the history
  • Loading branch information
blathers-crl[bot] authored Dec 23, 2024
2 parents 85b13dd + 1dad59b commit f4e054a
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions pkg/cmd/roachtest/tests/mixed_version_change_replicas.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,20 +348,27 @@ func setTenantSetting(
return errors.Wrapf(err, "failed to set %s", name)
}

return testutils.SucceedsSoonError(func() error {
var currentValue bool
if err := h.QueryRow(r, fmt.Sprintf("SHOW CLUSTER SETTING %s", name)).Scan(&currentValue); err != nil {
return errors.Wrapf(err, "failed to retrieve setting %s", name)
}
// Wait for the setting to be visible to all nodes in the tenant.
for _, n := range h.Tenant.Descriptor.Nodes {
db := h.Tenant.Connect(n)
if err := testutils.SucceedsSoonError(func() error {
var currentValue bool
if err := db.QueryRow(fmt.Sprintf("SHOW CLUSTER SETTING %s", name)).Scan(&currentValue); err != nil {
return errors.Wrapf(err, "failed to retrieve setting %s", name)
}

if currentValue != value {
err := fmt.Errorf(
"waiting for setting %s: current (%t) != expected (%t)", name, currentValue, value,
)
l.Printf("%v", err)
return err
}

if currentValue != value {
err := fmt.Errorf(
"waiting for setting %s: current (%t) != expected (%t)", name, currentValue, value,
)
l.Printf("%v", err)
return nil
}); err != nil {
return err
}

return nil
})
}
return nil
}

0 comments on commit f4e054a

Please sign in to comment.