(t *testing.T)
| 349 | } |
| 350 | |
| 351 | func isParallel(t *testing.T) (ret bool) { |
| 352 | t.Helper() |
| 353 | // This is a hack to determine if the test is running in parallel |
| 354 | // via property of t.Setenv. |
| 355 | defer func() { |
| 356 | if r := recover(); r != nil { |
| 357 | ret = true |
| 358 | } |
| 359 | }() |
| 360 | // Random variable name to avoid collisions. |
| 361 | t.Setenv(fmt.Sprintf("__TEST_CHECK_IS_PARALLEL_%d", rand.Int()), "1") |
| 362 | return false |
| 363 | } |
no outgoing calls
no test coverage detected