All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: ian.jackson@eu.citrix.com, Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH] timeout: adjust timeout when running nested tests
Date: Wed, 1 Apr 2020 15:37:40 +0200	[thread overview]
Message-ID: <20200401133740.64685-1-roger.pau@citrix.com> (raw)

Expand the timeouts when the host is nested. The current algorithm
uses base_timeout * 2 ^ nesting_level.

This fixes the issues reported by the nested tests on elbling boxes:

http://logs.test-lab.xenproject.org/osstest/logs/149283/

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 Osstest/TestSupport.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 1c13e2af..ff749a32 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -436,6 +436,7 @@ END
 
 sub target_adjust_timeout ($$) {
     my ($ho,$timeoutref) = @_; # $ho might be a $gho
+    my $nestinglvl = $ho->{NestingLevel} || $ho->{Host}{NestingLevel};
     my $adjust = sub {
 	my ($factor, $what) = @_;
 	return unless defined $factor;
@@ -450,6 +451,9 @@ sub target_adjust_timeout ($$) {
 	$adjust->(guest_var($ho,$guest_var), "guest variable $guest_var");
     }
     $adjust->(get_target_property($ho,"TimeoutFactor"), "target TimeoutFactor");
+    if ($nestinglvl) {
+        $adjust->(1 << $nestinglvl, "nesting level");
+    }
 }
 
 #---------- running commands eg on targets ----------
-- 
2.26.0



             reply	other threads:[~2020-04-01 13:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01 13:37 Roger Pau Monne [this message]
2020-04-01 16:45 ` [PATCH] timeout: adjust timeout when running nested tests Ian Jackson
2020-04-01 16:53   ` Roger Pau Monné
2020-04-01 17:02     ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200401133740.64685-1-roger.pau@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.