From: Michael Goldish Subject: Re: [PATCH] Increase waiting time before first session check in kvm_test_utils.reboot Date: Thu, 26 Nov 2009 02:08:23 -0500 (EST) Message-ID: <1215872155.707961259219303870.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> References: <1636501188.707901259219080948.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: autotest@test.kernel.org, kvm@vger.kernel.org, lmr@redhat.com To: Chen Cao Return-path: Received: from mx1.redhat.com ([209.132.183.28]:30574 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758899AbZKZHIS (ORCPT ); Thu, 26 Nov 2009 02:08:18 -0500 In-Reply-To: <1636501188.707901259219080948.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: ----- "Chen Cao" wrote: > Increase the sleeping time before the first check to 10 seconds, > and try every 2 seconds. > > But increasing these values cannot really solve the following > problem: > Guest is too heavy loaded, and have no time to response the > rebooting (method=shell) request, so session.is_responsive > returns > False, and we pass the first 'kvm_utils.wait_for'; > a WHILE later the load becomes lighter, and sshd (or rss) > become > responsive, whether or not is guest rebooting, here we are trying > to establish a session to the guest at this point, unfortunately, > we succeed and pass the second 'wait_for', before rebooting kills > sshd (or rss). > > Signed-off-by: Cao, Chen > --- > client/tests/kvm/kvm_test_utils.py | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/client/tests/kvm/kvm_test_utils.py > b/client/tests/kvm/kvm_test_utils.py > index bf8aed2..e183dc6 100644 > --- a/client/tests/kvm/kvm_test_utils.py > +++ b/client/tests/kvm/kvm_test_utils.py > @@ -91,7 +91,7 @@ def reboot(vm, session, method="shell", > sleep_before_reset=10, nic_index=0, > logging.error("Unknown reboot method: %s" % method) > > # Wait for the session to become unresponsive and close it > - if not kvm_utils.wait_for(lambda: not session.is_responsive(), > 120, 0, 1): > + if not kvm_utils.wait_for(lambda: not session.is_responsive(), > 120, 10, 2): By default, is_responsive() waits 5 secs before deciding the session is unresponsive. You can change that line to: if not kvm_utils.wait_for(lambda: not session.is_responsive(timeout=20), to give the session 20 secs to respond before it's deemed unresponsive. You can also make it 30. Will that be long enough? BTW, I'm just curious -- what load is running on the guest? Why would you want to reboot while the guest is loaded? > raise error.TestFail("Guest refuses to go down") > session.close() > > -- > 1.5.5.6 > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html