func (tf *testFixture) maxRates(t *testing.T, client throttlerclient.Client) { _, err := client.SetMaxRate(context.Background(), 23) if err != nil { t.Fatalf("Cannot execute remote command: %v", err) } got, err := client.MaxRates(context.Background()) if err != nil { t.Fatalf("Cannot execute remote command: %v", err) } want := map[string]int64{ "t1": 23, "t2": 23, } if !reflect.DeepEqual(got, want) { t.Fatalf("rate was not updated on all registered throttlers. got = %v, want = %v", got, throttlerNames) } }
func maxRatesPanics(t *testing.T, client throttlerclient.Client) { _, err := client.MaxRates(context.Background()) if !errorFromPanicHandler(err) { t.Fatalf("MaxRates RPC implementation does not catch panics properly: %v", err) } }