MCPcopy Index your code
hub / github.com/coder/coder / Go

Function Go

testutil/go.go:10–23  ·  view source on GitHub ↗

Go runs fn in a goroutine and waits until fn has completed before test completion. Done is returned for optionally waiting for fn to exit.

(t *testing.T, fn func())

Source from the content-addressed store, hash-verified

8// test completion. Done is returned for optionally waiting for fn to
9// exit.
10func Go(t *testing.T, fn func()) (done <-chan struct{}) {
11 t.Helper()
12
13 doneC := make(chan struct{})
14 t.Cleanup(func() {
15 <-doneC
16 })
17 go func() {
18 fn()
19 close(doneC)
20 }()
21
22 return doneC
23}

Callers 5

TestSSHFunction · 0.92
TestProvisionerJobFunction · 0.92
TestEnvFunction · 0.92

Calls 2

HelperMethod · 0.65
CleanupMethod · 0.65

Tested by 5

TestSSHFunction · 0.74
TestProvisionerJobFunction · 0.74
TestEnvFunction · 0.74