SetFailRate sets the percentage of requests that should fail (0-100).
(rate int)
| 89 | |
| 90 | // SetFailRate sets the percentage of requests that should fail (0-100). |
| 91 | func (h *HTTPTestServer) SetFailRate(rate int) { |
| 92 | h.mu.Lock() |
| 93 | defer h.mu.Unlock() |
| 94 | if rate < 0 { |
| 95 | rate = 0 |
| 96 | } else if rate > 100 { |
| 97 | rate = 100 |
| 98 | } |
| 99 | h.failRate = rate |
| 100 | } |
| 101 | |
| 102 | // GetRequests returns a copy of the requests received by the server. |
| 103 | func (h *HTTPTestServer) GetRequests() [][]byte { |
no outgoing calls