diff --git a/command/build_cancellation_test.go b/command/build_cancellation_test.go index f1a5959db..8ae637660 100644 --- a/command/build_cancellation_test.go +++ b/command/build_cancellation_test.go @@ -62,7 +62,11 @@ func TestBuildCommand_RunContext_CtxCancel(t *testing.T) { codeC := make(chan int) go func() { defer close(codeC) - codeC <- c.RunContext(ctx, tt.args) + cfg, ret := c.ParseArgs(tt.args) + if ret != 0 { + t.Fatal("ParseArgs failed.") + } + codeC <- c.RunContext(ctx, cfg) }() t.Logf("waiting for passing tests if any") b.wg.Wait() // ran `tt.parallelPassingTests` times