MCPcopy
hub / github.com/cloudflare/tableflip / TestParentExit

Function TestParentExit

parent_test.go:7–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

5)
6
7func TestParentExit(t *testing.T) {
8 env, procs := testEnv()
9 child, err := startChild(env, nil)
10 if err != nil {
11 t.Fatal(err)
12 }
13
14 proc := <-procs
15 _, exited, err := proc.notify()
16 if err != nil {
17 t.Fatal(err)
18 }
19
20 readyFile := <-child.ready
21 if _, err = readyFile.Write([]byte{1}); err != nil {
22 t.Fatal("Can't inject garbage from parent")
23 }
24 if err := readyFile.Close(); err != nil {
25 t.Fatal(err)
26 }
27
28 err = <-exited
29 if err == nil {
30 t.Fatal("Expect child to detect garbage from parent")
31 }
32}

Callers

nothing calls this directly

Calls 3

testEnvFunction · 0.85
startChildFunction · 0.85
notifyMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…