Gitlab custom executor exit status

I am trying to set up autoscaling using AWS fargate following this guide here.

It seems to work fine, but the is something strange with how the machine exits.
for instance in step 7 here Autoscaling GitLab CI on AWS Fargate | GitLab, change the script to just exit 1

test:
  script:
    - exit 1

I would expect that the pipeline exits with error code 1, which i think would be classified as a failed test.

Running with gitlab-runner 15.8.1

Here is a snippet from my pipeline

$ exit 1
ERRO[2023-02-20T17:44:26Z] Application execution failed                  PID=28293 error="executing the script on the remote host: executing script on container with IP \"...\": executing script: executing remote script: executing SSH command: Process exited with status 1"
Running after_script
00:00
INFO[2023-02-20T17:44:26Z] Starting fargate                              PID=28298 version="0.2.0 (..)"
INFO[2023-02-20T17:44:26Z] Executing the command                         PID=28298 command=run_exec stage=after_script
INFO[2023-02-20T17:44:26Z] Reading file content                          PID=28298 command=run_exec file=/tmp/custom-.../script284....../script. stage=after_script
INFO[2023-02-20T17:44:26Z] Fetching task data from metadata storage      PID=28298 command=run_exec stage=after_script
INFO[2023-02-20T17:44:26Z] Executing script in the task container        PID=28298 command=run_exec stage=after_script taskARN="arn:aws:ecs:us-.-2:...:task/gitlab-runner-.../..."
Running after script...
$ echo done
done
Cleaning up project directory and file based variables
00:00
INFO[2023-02-20T17:44:26Z] Starting fargate                              PID=28303 version="0.2.0 (..)"
INFO[2023-02-20T17:44:26Z] Executing the command                         PID=28303 command=run_exec stage=cleanup_file_variables
INFO[2023-02-20T17:44:26Z] Reading file content                          PID=28303 command=run_exec file=/tmp/custom-../../script. stage=cleanup_file_variables
INFO[2023-02-20T17:44:26Z] Fetching task data from metadata storage      PID=28303 command=run_exec stage=cleanup_file_variables
INFO[2023-02-20T17:44:26Z] Executing script in the task container        PID=28303 command=run_exec stage=cleanup_file_variables taskARN="arn:aws:ecs:us-.-2:..:task/gitlab-runner-.../.."
ERROR: Job failed (system failure): exit status 2
1 Like