(t *testing.T, d time.Duration, msg string, fn func())
| 13 | ) |
| 14 | |
| 15 | func mustFinishCore(t *testing.T, d time.Duration, msg string, fn func()) { |
| 16 | t.Helper() |
| 17 | done := make(chan struct{}) |
| 18 | go func() { fn(); close(done) }() |
| 19 | select { |
| 20 | case <-done: |
| 21 | case <-time.After(d): |
| 22 | t.Fatalf("timeout: %s", msg) |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | func TestRecordStat_ConcurrentSafety(t *testing.T) { |
| 27 | r := &Runner{} |
no outgoing calls
no test coverage detected