chiark / gitweb /
* adt-run: increase timeouts 100s, 3ks, 10ks, 100ks.
authorIan Jackson <ian@davenant.greenend.org.uk>
Tue, 28 Aug 2007 16:28:24 +0000 (17:28 +0100)
committerIan Jackson <ian@davenant.greenend.org.uk>
Tue, 28 Aug 2007 16:28:24 +0000 (17:28 +0100)
* options for setting timeouts.

debian/changelog
runner/adt-run
runner/adt-run.1

index 3a3c4d67425a5c10ea90c2b8825572367fc99e73..449d39aea7a2c2d69549f0d03af7ce3c72a4d2f5 100644 (file)
@@ -4,7 +4,7 @@ autopkgtest (1.0.4) unstable; urgency=low
     Architecture: field corrected so package selection works properly.
   * adt-testreport-onepackage: use ln -f when installing summary.
   * hosts/cadmium/*: new directory for stuff on Canonical buildd.
-  * adt-run: increase timeouts 10s, 3ks, 10ks, 100ks.
+  * adt-run: increase timeouts 100s, 3ks, 10ks, 100ks.
   * adt-testreport-onepackage: suppress repetitive emails.
   * hosts/cadmium/onepackage-config: change destination directory
   * adt-testreport-onepackage: support for Launchpad bug filing
@@ -14,6 +14,7 @@ autopkgtest (1.0.4) unstable; urgency=low
     in existing bugs suppression file.
   * hosts/cadmium/*: convenience scripts changed.
   * better formatting and explanations in some emails.
+  * options for setting timeouts.
 
  --
 
index eb4fb2c16ba590baacccc768f04153a68a964e52..c14e9265821e3aef19f0a41f5703df0a0b9d8b30 100755 (executable)
@@ -45,7 +45,7 @@ signal.signal(signal.SIGINT, signal.SIG_DFL) # undo stupid Python SIGINT thing
 tmpdir = None          # pathstring on host
 testbed = None         # Testbed
 errorcode = 0          # exit status that we are going to use
-timeouts = { 'short':10, 'install':3000, 'test':10000, 'build':100000 }
+timeouts = { 'short':100, 'install':3000, 'test':10000, 'build':100000 }
 binaries = None                # Binaries (.debs we have registered)
 build_essential = ["build-essential"]
 
@@ -408,7 +408,7 @@ class Action:
        return "<Action %s %s %s>" % (a.kind, a.what, `a.af`)
 
 def parse_args():
-       global opts
+       global opts, timeouts
        global n_non_actions # argh, stupid python scoping rules
        usage = "%prog <options> --- <virt-server>..."
        parser = OptionParser(usage=usage)
@@ -558,6 +558,13 @@ def parse_args():
                help='write a summary report to SUMMARY,'
                     ' emptying it beforehand')
 
+       for k in timeouts.keys():
+               pa('','--timeout-'+k,   type='int', dest='timeout_'+k,
+                       metavar='T', help='set %s timeout to T')
+       pa('','--timeout-factor',       type='float', dest='timeout_factor',
+                       metavar='FACTOR', default=1.0,
+                       help='multiply all default timeouts by FACTOR')
+
        pa('','--user',                 type='string', dest='user',
                help='run tests as USER (needs root on testbed)')
        pa('','--gain-root',            type='string', dest='gainroot',
@@ -594,6 +601,11 @@ def parse_args():
        if n_non_actions >= len(parser.largs):
                parser.error('nothing to do specified')
 
+       for k in timeouts.keys():
+               t = getattr(opts,'timeout_'+k)
+               if t is None: t = timeouts[k] * opts.timeout_factor
+               timeouts[k] = int(t)
+
        arghandling = initial_arghandling
        opts.actions = []
        ix = 0
@@ -654,7 +666,7 @@ def setup_trace():
        if opts.summary is not None:
                summary_stream = open(opts.summary, 'w', 0)
 
-       debug('options: '+`opts`, 1)
+       debug('options: '+`opts`+'; timeouts: '+`timeouts`, 1)
 
 def finalise_options():
        global opts, tb, build_essential
index fda5fd683fa16c2787ae6d5f942e07133667bbdd..ff1a661efae13e3d9ad96d00445b62dfa225d06a 100644 (file)
@@ -159,6 +159,27 @@ Specifies that a summary of the outcome should be written to
 in any case.
 \fIsummary\fR is not affected by \fB--paths-testbed\fR.
 .TP
+.BR --timeout- \fIwhich\fR = \fIseconds\fR
+Use a different timeout for operations on or with the testbed.  There
+are four timeouts affected by four values of \fIwhich\fR:
+.BR short :
+supposedly
+short operations like setting up the testbed's apt and checking the
+state (default: 100s);
+.BR install :
+installation of packages including dependencies
+(default: 3ks);
+.BR test :
+test runs (default: 10ks); and
+.BR build :
+builds (default:
+100ks).  The value must be specified as an integer number of seconds.
+.TP
+.BR --timeout-factor =\fIdouble\fR
+Multiply all of the default timeouts by the specified factor (see
+\fB--timeout-\fR\fIwhich\fR above).  Only the defaults are affected;
+explicit timeout settings are used exactly as specified.
+.TP
 .BR --debug | -d
 Include additional debugging information in the trace log.  Each
 additional \fB-d\fR increases the debugging level; the current maximum