| 1 | package test |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | "time" |
| 6 | ) |
| 7 | |
| 8 | func TestCheckRoutines(t *testing.T) { |
| 9 | // Limit runtime in case of deadlocks |
| 10 | lim := TimeOut(time.Second * 20) |
| 11 | defer lim.Stop() |
| 12 | |
| 13 | // Check for leaking routines |
| 14 | report := CheckRoutines(t) |
| 15 | defer report() |
| 16 | |
| 17 | go func() { |
| 18 | time.Sleep(1 * time.Second) |
| 19 | }() |
| 20 | } |