@@ -546,10 +546,8 @@ func TestTemplatePush(t *testing.T) {
546546 require .NoError (t , tt .setupDaemon (setupCtx , store , owner , wantTags , now ))
547547
548548 ctx := testutil .Context (t , testutil .WaitMedium )
549- cancelCtx , cancel := context .WithCancel (ctx )
550- defer cancel ()
551- inv = inv .WithContext (cancelCtx )
552- w := clitest .StartWithWaiter (t , inv )
549+ inv = inv .WithContext (ctx )
550+ clitest .Start (t , inv ) // Only used for output, disregard exit status.
553551
554552 require .Eventually (t , func () bool {
555553 jobs , err := store .GetProvisionerJobsCreatedAfter (ctx , time.Time {})
@@ -565,9 +563,6 @@ func TestTemplatePush(t *testing.T) {
565563 if tt .expectOutput != "" {
566564 pty .ExpectMatchContext (ctx , tt .expectOutput )
567565 }
568-
569- cancel ()
570- _ = w .Wait ()
571566 })
572567 }
573568 })
@@ -1106,21 +1101,22 @@ func TestTemplatePush(t *testing.T) {
11061101 pty .ExpectMatchContext (ctx , "Upload" )
11071102 pty .WriteLine ("yes" )
11081103
1109- pty . ExpectMatchContext ( ctx , "var.string_var" )
1110- pty . ExpectMatchContext ( ctx , "Enter value: " )
1111- pty .WriteLine ( "test-string " )
1104+ // Variables are prompted in alphabetical order.
1105+ // Boolean variable automatically selects the first option ("true ")
1106+ pty .ExpectMatchContext ( ctx , "var.bool_var " )
11121107
11131108 pty .ExpectMatchContext (ctx , "var.number_var" )
11141109 pty .ExpectMatchContext (ctx , "Enter value:" )
11151110 pty .WriteLine ("42" )
11161111
1117- // Boolean variable automatically selects the first option ("true")
1118- pty .ExpectMatchContext (ctx , "var.bool_var" )
1119-
11201112 pty .ExpectMatchContext (ctx , "var.sensitive_var" )
11211113 pty .ExpectMatchContext (ctx , "Enter value:" )
11221114 pty .WriteLine ("secret-value" )
11231115
1116+ pty .ExpectMatchContext (ctx , "var.string_var" )
1117+ pty .ExpectMatchContext (ctx , "Enter value:" )
1118+ pty .WriteLine ("test-string" )
1119+
11241120 w .RequireSuccess ()
11251121 })
11261122
0 commit comments