[PATCH] D130064: Implement timeout for ClangBuilder

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 19 01:26:51 PDT 2022


ro created this revision.
ro added a reviewer: gkistanova.
ro added a project: Zorg.
Herald added a project: All.
ro requested review of this revision.

As a followup to D129961 <https://reviews.llvm.org/D129961>, this patch actually implements for `timeout` parameter for `ClangBuilder`.

I've only passed it to the actual build and test steps (`build stage [12]`, `ninja check [12]`, and `test-suite`.

This is untested and derived from my understanding that both `WarningCountingShellCommand` and `LitTestCommand` resp. their superclasses implement the `timeout` parameter.  It's unfortunate that I have to hardcode the default value (`1200`) to keep if unchanged if not specified, but I found no better way given that `None` means no timeout.


Repository:
  rZORG LLVM Github Zorg

https://reviews.llvm.org/D130064

Files:
  zorg/buildbot/builders/ClangBuilder.py


Index: zorg/buildbot/builders/ClangBuilder.py
===================================================================
--- zorg/buildbot/builders/ClangBuilder.py
+++ zorg/buildbot/builders/ClangBuilder.py
@@ -136,7 +136,7 @@
             checks=None,
             cmake='cmake',
             jobs=None,
-            timeout=None, # TODO: Implement support for timeout
+            timeout=1200,
 
             # VS tools environment variable if using MSVC. For example,
             # %VS120COMNTOOLS% selects the 2013 toolchain.
@@ -168,7 +168,8 @@
             checkout_flang=False,
             checkout_test_suite=False):
     return _getClangCMakeBuildFactory(
-               clean=clean, checks=checks, cmake=cmake, jobs=jobs, vs=vs,
+               clean=clean, checks=checks, cmake=cmake, jobs=jobs,
+               timeout=timeout,vs=vs,
                vs_target_arch=vs_target_arch, useTwoStage=useTwoStage,
                testStage1=testStage1, stage1_config=stage1_config,
                stage2_config=stage2_config, runTestSuite=runTestSuite,
@@ -187,6 +188,7 @@
             checks=None,
             cmake='cmake',
             jobs=None,
+            timeout=1200,
 
             # VS tools environment variable if using MSVC. For example,
             # %VS120COMNTOOLS% selects the 2013 toolchain.
@@ -345,6 +347,7 @@
 
     f.addStep(WarningCountingShellCommand(name='build stage 1',
                                           command=ninja_cmd,
+                                          timeout=timeout,
                                           haltOnFailure=True,
                                           description='ninja all',
                                           workdir=stage1_build,
@@ -354,6 +357,7 @@
         haltOnStage1Check = not useTwoStage and not runTestSuite
         f.addStep(LitTestCommand(name='ninja check 1',
                                  command=ninja_check_cmd,
+                                 timeout=timeout,
                                  haltOnFailure=haltOnStage1Check,
                                  description=["checking stage 1"],
                                  descriptionDone=["stage 1 checked"],
@@ -436,6 +440,7 @@
 
         f.addStep(WarningCountingShellCommand(name='build stage 2',
                                               command=ninja_cmd,
+                                              timeout=timeout,
                                               haltOnFailure=True,
                                               description='ninja all',
                                               workdir=stage2_build,
@@ -444,6 +449,7 @@
         if checks:
             f.addStep(LitTestCommand(name='ninja check 2',
                                      command=ninja_check_cmd,
+                                     timeout=timeout,
                                      haltOnFailure=not runTestSuite,
                                      description=["checking stage 2"],
                                      descriptionDone=["stage 2 checked"],
@@ -548,6 +554,7 @@
                                env=env))
         f.addStep(LitTestCommand(
                                name='test-suite',
+                               timeout=timeout,
                                command=test_suite_cmd,
                                haltOnFailure=True,
                                description=['running the test suite'],


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130064.445721.patch
Type: text/x-patch
Size: 3419 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220719/af83684f/attachment.bin>


More information about the llvm-commits mailing list