From 126979ff117ac0f6fe1a1b7271d50e99a2106778 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Tue, 2 Mar 2021 13:01:15 +0100
Subject: [PATCH] fix: remove docker setTimeout (#8940)

---
 lib/util/exec/index.ts | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/lib/util/exec/index.ts b/lib/util/exec/index.ts
index 4c0dba5a92..8217ededfc 100644
--- a/lib/util/exec/index.ts
+++ b/lib/util/exec/index.ts
@@ -140,15 +140,8 @@ export async function exec(
   let res: ExecResult | null = null;
   for (const rawExecCommand of commands) {
     const startTime = Date.now();
-    let timer;
-    const { timeout } = rawExecOptions;
     if (useDocker) {
       await removeDockerContainer(docker.image);
-      // istanbul ignore next
-      timer = setTimeout(() => {
-        removeDockerContainer(docker.image); // eslint-disable-line
-        logger.info({ timeout, rawExecCommand }, 'Docker run timed out');
-      }, timeout);
     }
     logger.debug({ command: rawExecCommand }, 'Executing command');
     logger.trace({ commandOptions: rawExecOptions }, 'Command options');
@@ -156,7 +149,6 @@ export async function exec(
       res = await rawExec(rawExecCommand, rawExecOptions);
     } catch (err) {
       logger.trace({ err }, 'rawExec err');
-      clearTimeout(timer);
       if (useDocker) {
         await removeDockerContainer(docker.image).catch((removeErr: Error) => {
           const message: string = err.message;
@@ -167,7 +159,6 @@ export async function exec(
       }
       throw err;
     }
-    clearTimeout(timer);
     const durationMs = Math.round(Date.now() - startTime);
     if (res) {
       logger.debug(
-- 
GitLab