Commit cdd8d0e2f4

cdd8d0e2f4a9d14b694fa1e59695d7f13ef20424

parent: 55165106cd

Verified · cmc

cmc <hello@cleberg.net> · 2026-09-23 06:04 UTC

e2e: kill the followed ssh process when the test fails

Ref #250
e2e/buildfollow_test.go +9
@@ -102,6 +102,15 @@ func TestBuildLogFollow(t *testing.T) {
102102 if err := cmd.Start(); err != nil {
103103 t.Fatal(err)
104104 }
105 // If the test fails before the final cmd.Wait below, kill the follow
106 // instead of leaving it running. Once that Wait has run,
107 // cmd.ProcessState is set and this is a no-op.
108 defer func() {
109 if cmd.ProcessState == nil {
110 cmd.Process.Kill()
111 cmd.Wait()
112 }
113 }()
105114 follow := newStreamReader(stdout)
106115
107116 page, err := http.Get(fmt.Sprintf("http://127.0.0.1:%d/alice/app/builds/1", inst.httpPort))