Skip to content

Commit

Permalink
Fix retry loops that use t (#2311)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashwin Venkatesh authored Jun 8, 2023
1 parent 57fef1f commit e35eaa3
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion acceptance/tests/cli/cli_install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestInstall(t *testing.T) {
retry.RunWith(retrier, t, func(r *retry.R) {
for podName := range list {
out, err := cli.Run(t, ctx.KubectlOptions(t), "proxy", "read", podName)
require.NoError(t, err)
require.NoError(r, err)

output := string(out)
logger.Log(t, output)
Expand Down
58 changes: 29 additions & 29 deletions acceptance/tests/config-entries/config_entries_namespaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,35 +242,35 @@ func TestControllerNamespaces(t *testing.T) {
require.NoError(r, err)
rateLimitIPConfigEntry, ok := entry.(*api.RateLimitIPConfigEntry)
require.True(r, ok, "could not cast to RateLimitIPConfigEntry")
require.Equal(t, "permissive", rateLimitIPConfigEntry.Mode)
require.Equal(t, 100.0, rateLimitIPConfigEntry.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.ACL.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.ACL.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Catalog.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Catalog.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.ConfigEntry.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.ConfigEntry.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.ConnectCA.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.ConnectCA.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Coordinate.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Coordinate.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.DiscoveryChain.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.DiscoveryChain.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Health.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Health.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Intention.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Intention.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.KV.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.KV.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Tenancy.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Tenancy.WriteRate)
//require.Equal(t, 100.0, rateLimitIPConfigEntry.PreparedQuery.ReadRate)
//require.Equal(t, 100.0, rateLimitIPConfigEntry.PreparedQuery.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Session.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Session.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Txn.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Txn.WriteRate)
require.Equal(r, "permissive", rateLimitIPConfigEntry.Mode)
require.Equal(r, 100.0, rateLimitIPConfigEntry.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.ACL.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.ACL.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Catalog.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Catalog.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.ConfigEntry.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.ConfigEntry.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.ConnectCA.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.ConnectCA.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Coordinate.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Coordinate.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.DiscoveryChain.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.DiscoveryChain.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Health.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Health.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Intention.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Intention.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.KV.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.KV.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Tenancy.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Tenancy.WriteRate)
//require.Equal(r, 100.0, rateLimitIPConfigEntry.PreparedQuery.ReadRate)
//require.Equal(r, 100.0, rateLimitIPConfigEntry.PreparedQuery.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Session.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Session.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Txn.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Txn.WriteRate)
})
}

Expand Down
58 changes: 29 additions & 29 deletions acceptance/tests/config-entries/config_entries_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,35 +209,35 @@ func TestController(t *testing.T) {
require.NoError(r, err)
rateLimitIPConfigEntry, ok := entry.(*api.RateLimitIPConfigEntry)
require.True(r, ok, "could not cast to RateLimitIPConfigEntry")
require.Equal(t, "permissive", rateLimitIPConfigEntry.Mode)
require.Equal(t, 100.0, rateLimitIPConfigEntry.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.ACL.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.ACL.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Catalog.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Catalog.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.ConfigEntry.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.ConfigEntry.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.ConnectCA.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.ConnectCA.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Coordinate.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Coordinate.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.DiscoveryChain.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.DiscoveryChain.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Health.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Health.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Intention.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Intention.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.KV.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.KV.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Tenancy.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Tenancy.WriteRate)
//require.Equal(t, 100.0, rateLimitIPConfigEntry.PreparedQuery.ReadRate)
//require.Equal(t, 100.0, rateLimitIPConfigEntry.PreparedQuery.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Session.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Session.WriteRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Txn.ReadRate)
require.Equal(t, 100.0, rateLimitIPConfigEntry.Txn.WriteRate, 100.0)
require.Equal(r, "permissive", rateLimitIPConfigEntry.Mode)
require.Equal(r, 100.0, rateLimitIPConfigEntry.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.ACL.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.ACL.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Catalog.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Catalog.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.ConfigEntry.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.ConfigEntry.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.ConnectCA.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.ConnectCA.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Coordinate.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Coordinate.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.DiscoveryChain.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.DiscoveryChain.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Health.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Health.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Intention.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Intention.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.KV.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.KV.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Tenancy.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Tenancy.WriteRate)
//require.Equal(r, 100.0, rateLimitIPConfigEntry.PreparedQuery.ReadRate)
//require.Equal(r, 100.0, rateLimitIPConfigEntry.PreparedQuery.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Session.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Session.WriteRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Txn.ReadRate)
require.Equal(r, 100.0, rateLimitIPConfigEntry.Txn.WriteRate)

})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ func TestRun_WaitsForMeshGatewayInstances(t *testing.T) {
CAFile: caFile,
},
})
require.NoError(t, err)
require.NoError(r, err)
})

err = client.Agent().ServiceRegister(&api.AgentServiceRegistration{
Expand Down Expand Up @@ -825,7 +825,7 @@ func TestRun_ReplicationSecretDelay(t *testing.T) {
},
},
metav1.CreateOptions{})
require.NoError(t, err)
require.NoError(r, err)
})
}()

Expand Down Expand Up @@ -1005,7 +1005,7 @@ func TestRun_ConsulClientDelay(t *testing.T) {
Server: randomPorts[5],
}
})
require.NoError(t, err)
require.NoError(r, err)
})

// Construct Consul client.
Expand Down

0 comments on commit e35eaa3

Please sign in to comment.