Job with allow_failure with exit_codes parameter fails.
Summary
When I run a GitLab Runner (v15.10.1) installed on my own computer and specify the allow_failure
and exit_codes
parameters in a job, the pipeline fails even though the script returns an exit code that is allowed. When I run the same job on a shared runner (v15.9.0), it works as expected.
Steps to reproduce
- install Gitalb Runner on Windows machine
- register runner with docker type
- run example job
.gitlab-ci.yml
stages:
- test
Test:
stage: test
script:
- echo "Hello word"
- exit 123
allow_failure:
exit_codes: 123
Actual behavior
The job ends in failure.
Expected behavior
The job should conclude with a successful outcome
Relevant logs and/or screenshots
job log
Running with gitlab-runner 15.10.1 (dcfb4b66)
on ***-****** ******, system ID: ******
Resolving secrets
Preparing the "docker" executor
Using Docker executor with image node:18-alpine ...
Pulling docker image node:18-alpine ...
Using docker image sha256:305c985a481fc143f40c3a5c1cb398756057851f3ab748e381c76fd1ce5b0177 for node:18-alpine with digest node@sha256:47d97b93629d9461d64197773966cc49081cf4463b1b07de5a38b6bd5acfbe9d ...
Preparing environment
Running on ****** via ******...
Getting source from Git repository
Fetching changes with git depth set to 20...
Initialized empty Git repository in /builds/******/******/.git/
Created fresh repository.
Checking out 34030438 as detached HEAD (ref is main)...
Skipping Git submodules setup
Executing "step_script" stage of the job script
Using docker image sha256:305c985a481fc143f40c3a5c1cb398756057851f3ab748e381c76fd1ce5b0177 for node:18-alpine with digest node@sha256:47d97b93629d9461d64197773966cc49081cf4463b1b07de5a38b6bd5acfbe9d ...
$ echo "Hello word"
Hello word
$ exit 123
Cleaning up project directory and file based variables
ERROR: Job failed: exit code 123
Environment description
config.toml contents
concurrent = 0
check_interval = 0
shutdown_timeout = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "*******"
url = "https://gitlab.com/"
id = ***********
token = "***************"
token_obtained_at = 2023-04-06T10:44:17Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "docker"
[runners.docker]
tls_verify = false
image = "node:18-alpine"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
Used GitLab Runner version
Version: 15.10.1
Git revision: dcfb4b66
Git branch: 15-10-stable
GO version: go1.19.6
Built: 2023-03-29T13:01:33+0000
OS/Arch: windows/amd64