Override the timer used by the DNS resolver to fire after a duration of d.
(t *testing.T, d time.Duration)
| 78 | |
| 79 | // Override the timer used by the DNS resolver to fire after a duration of d. |
| 80 | func overrideTimeAfterFunc(t *testing.T, d time.Duration) { |
| 81 | origTimeAfter := dnsinternal.TimeAfterFunc |
| 82 | dnsinternal.TimeAfterFunc = func(time.Duration) <-chan time.Time { |
| 83 | return time.After(d) |
| 84 | } |
| 85 | t.Cleanup(func() { dnsinternal.TimeAfterFunc = origTimeAfter }) |
| 86 | } |
| 87 | |
| 88 | // Override the timer used by the DNS resolver as follows: |
| 89 | // - use the durChan to read the duration that the resolver wants to wait for |
no outgoing calls
no test coverage detected