@@ -2385,6 +2385,7 @@ describe("package artifact reuse", () => {
23852385 const checkTestboxJob = workflowJob ( CI_CHECK_TESTBOX_WORKFLOW , "check" ) ;
23862386 const setupNodeStep = workflowStep ( checkTestboxJob , "Setup Node environment" ) ;
23872387 const runTestboxStep = workflowStep ( checkTestboxJob , "Run Testbox" ) ;
2388+ const closeTestboxSshStep = workflowStep ( checkTestboxJob , "Close Testbox SSH sessions" ) ;
23882389 const runArmTestboxStep = workflowStep (
23892390 workflowJob ( CI_CHECK_ARM_TESTBOX_WORKFLOW , "check-arm" ) ,
23902391 "Run Testbox" ,
@@ -2411,7 +2412,14 @@ describe("package artifact reuse", () => {
24112412 "${{ fromJSON(inputs.timeout_minutes || '120') }}" ,
24122413 ) ;
24132414 expect ( runTestboxStep . uses ) . toContain ( "useblacksmith/run-testbox@" ) ;
2414- expect ( runTestboxStep . if ) . toBe ( "github.event_name == 'workflow_dispatch' && always()" ) ;
2415+ expect ( runTestboxStep . if ) . toBe ( "github.event_name == 'workflow_dispatch' && !cancelled()" ) ;
2416+ expect ( closeTestboxSshStep . if ) . toBe ( "github.event_name == 'workflow_dispatch' && always()" ) ;
2417+ expect ( closeTestboxSshStep . run ) . toContain (
2418+ 'ss -K state established \\\n "( sport = :${runner_ssh_port} )"' ,
2419+ ) ;
2420+ expect ( checkTestboxJob . steps . indexOf ( closeTestboxSshStep ) ) . toBe (
2421+ checkTestboxJob . steps . indexOf ( runTestboxStep ) + 1 ,
2422+ ) ;
24152423 expect ( runArmTestboxStep . if ) . toBe ( "always()" ) ;
24162424 expect ( runBuildArtifactsTestboxStep . if ) . toBe ( "always()" ) ;
24172425 expect ( runWindowsTestboxStep . if ) . toBe ( "always()" ) ;
0 commit comments