MCPcopy Create free account
hub / github.com/chainreactors/spray / mustFinishCore

Function mustFinishCore

core/runner_test.go:15–24  ·  view source on GitHub ↗
(t *testing.T, d time.Duration, msg string, fn func())

Source from the content-addressed store, hash-verified

13)
14
15func 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
26func TestRecordStat_ConcurrentSafety(t *testing.T) {
27 r := &Runner{}

Calls

no outgoing calls

Tested by

no test coverage detected