MCPcopy Create free account
hub / github.com/coder/envbuilder / isParallel

Function isParallel

log/coder_internal_test.go:351–363  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

349}
350
351func 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}

Callers 1

testReplaceTimeoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected