oneTimeAllowingThrottler returns a fake throttler which does not throttle requests until the client RPC succeeds, but throttles everything that comes after. This is useful for tests which need to set up a valid cache entry before testing other cases.
(firstRPCDone *grpcsync.Event)
| 104 | // after. This is useful for tests which need to set up a valid cache entry |
| 105 | // before testing other cases. |
| 106 | func oneTimeAllowingThrottler(firstRPCDone *grpcsync.Event) *fakeThrottler { |
| 107 | return &fakeThrottler{ |
| 108 | throttleFunc: firstRPCDone.HasFired, |
| 109 | throttleCh: make(chan struct{}, 1), |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | func overrideAdaptiveThrottler(t *testing.T, f *fakeThrottler) { |
| 114 | origAdaptiveThrottler := newAdaptiveThrottler |
no outgoing calls
no test coverage detected