rob05c commented on a change in pull request #3163: Fix Traffic Ops Tenancy and
Activity Bugs, Fix TO API Test Framework to work with Tenancy
URL: https://github.com/apache/trafficcontrol/pull/3163#discussion_r243868965
##########
File path: traffic_ops/testing/api/v14/parameters_test.go
##########
@@ -115,9 +115,14 @@ func DeleteTestParameter(t *testing.T, pl tc.Parameter) {
if err != nil {
t.Errorf("cannot GET Parameter by name: %v - %v\n", pl.Name,
err)
}
- if len(resp) > 0 {
- respParameter := resp[0]
+ if len(resp) == 0 {
+ t.Errorf("DeleteTestParameter got no params for %+v %+v\n",
pl.Name, pl.ConfigFile)
+ } else if len(resp) > 1 {
+ // TODO figure out why this happens, and be more precise about
deleting things where created.
+ // t.Errorf("DeleteTestParameter params for %+v %+v expected 1,
actual %+v\n", pl.Name, pl.ConfigFile, len(resp))
+ }
+ for _, respParameter := range resp {
Review comment:
This fixes a race, where certain tests would create additional parameters
with the same name+file (which is permissible, as long as the values are
different). This fixes it to delete all returned parameters.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services