Pass job timeout in steps RunRequest so server can also enforce job timeouts
This is the second half of Enforce job timeout on server side (step-runner!368 - merged). That MR will have to be merged and released before we can merge this MR.
I added the following integration tests, but then realized it was pointless because job timeouts are already being handled on the client side. Maybe it's still a worthwhile test?
From 415d4bc415a5bdd7b7094f51039cb018cea18ead Mon Sep 17 00:00:00 2001
From: Axel von Bertoldi <avonbertoldi@gitlab.com>
Date: Thu, 12 Feb 2026 09:24:01 -0700
Subject: [PATCH] Add pointless integration test
---
executors/docker/docker_steps_integration_test.go | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/executors/docker/docker_steps_integration_test.go b/executors/docker/docker_steps_integration_test.go
index fbc484aa0..c80dd5a58 100644
--- a/executors/docker/docker_steps_integration_test.go
+++ b/executors/docker/docker_steps_integration_test.go
@@ -30,6 +30,7 @@ func Test_StepsIntegration(t *testing.T) {
services spec.Services
wantOut []string
wantErr bool
+ timeout int
}{
"script": {
steps: `- name: echo
@@ -73,6 +74,13 @@ func Test_StepsIntegration(t *testing.T) {
},
wantErr: true,
},
+ "job with too short timeout should fail with timeout": {
+ steps: `- name: pause
+ script: sleep 2s`,
+ wantOut: []string{"ERROR: Job failed: execution took longer than 1s seconds"},
+ wantErr: true,
+ timeout: 1,
+ },
}
for name, tt := range tests {
@@ -96,6 +104,10 @@ func Test_StepsIntegration(t *testing.T) {
},
}
+ if tt.timeout != 0 {
+ build.RunnerInfo.Timeout = tt.timeout
+ }
+
wantOut := tt.wantOut
out, err := buildtest.RunBuildReturningOutput(t, build)
if !tt.wantErr {
--
Edited by Axel von Bertoldi