func (tf *testFixture) setMaxRate(t *testing.T, client throttlerclient.Client) { got, err := client.SetMaxRate(context.Background(), 23) if err != nil { t.Fatalf("Cannot execute remote command: %v", err) } if !reflect.DeepEqual(got, throttlerNames) { t.Fatalf("rate was not updated on all registered throttlers. got = %v, want = %v", got, throttlerNames) } }
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 setMaxRatePanics(t *testing.T, client throttlerclient.Client) { _, err := client.SetMaxRate(context.Background(), 23) if !errorFromPanicHandler(err) { t.Fatalf("SetMaxRate RPC implementation does not catch panics properly: %v", err) } }