Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Jon Mason <jdmason@kudzu.us>, openembedded-core@lists.openembedded.org
Subject: Re: [PATCH v2] oe_syslog.py: Handle syslogd/klogd restart race
Date: Sat, 22 Jun 2019 09:08:04 +0100	[thread overview]
Message-ID: <30d4f80b522e6bcb23143a804eb44fc5067b3b47.camel@linuxfoundation.org> (raw)
In-Reply-To: <20190621192710.15428-1-jdmason@kudzu.us>

On Fri, 2019-06-21 at 15:27 -0400, Jon Mason wrote:
> syslogd and klogd can occasionally take too long to restart, which
> causes tests to fail by starting before the log daemons are ready.  To
> work around this problem, poll for up to 30 seconds on the processes to
> verify the old ones are killed and the new ones are up and running.
> 
> [YOCTO #13379]
> 
> Signed-off-by: Jon Mason <jdmason@kudzu.us>
> ---
>  meta/lib/oeqa/runtime/cases/oe_syslog.py | 54 +++++++++++++++++++++---
>  1 file changed, 48 insertions(+), 6 deletions(-)
> 
> diff --git a/meta/lib/oeqa/runtime/cases/oe_syslog.py b/meta/lib/oeqa/runtime/cases/oe_syslog.py
> index 0f5f9f43ca..480aadedf9 100644
> --- a/meta/lib/oeqa/runtime/cases/oe_syslog.py
> +++ b/meta/lib/oeqa/runtime/cases/oe_syslog.py
> @@ -6,6 +6,7 @@ from oeqa.runtime.case import OERuntimeTestCase
>  from oeqa.core.decorator.depends import OETestDepends
>  from oeqa.core.decorator.data import skipIfDataVar
>  from oeqa.runtime.decorator.package import OEHasPackage
> +import time
>  
>  class SyslogTest(OERuntimeTestCase):
>  
> @@ -21,6 +22,49 @@ class SyslogTest(OERuntimeTestCase):
>  
>  class SyslogTestConfig(OERuntimeTestCase):
>  
> +    def test_syslog_restart_sanity(self):
> +        status, syslogd_pid = self.target.run('pidof syslogd')
> +        status, klogd_pid = self.target.run('pidof klogd')

FWIW by calling this test_, it will be run as a standalone test. This
may have two issues:

a) it won't work on a systemd image
b) its missing dependency markup (is syslog running?) that the other
tests have

Unless we really want it as a standalone test (I think there is a
similar one already), the fix may be just to rename it something other
than starting with test_.

Cheers,

Richard

> +        status, output = self.target.run('/etc/init.d/syslog restart')
> +
> +        # Always check for an error, most likely a race between shutting down and starting up
> +        timeout = time.time() + 30
> +
> 



  parent reply	other threads:[~2019-06-22  8:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-21 19:27 [PATCH v2] oe_syslog.py: Handle syslogd/klogd restart race Jon Mason
2019-06-22  8:02 ` Richard Purdie
2019-06-22  8:08 ` Richard Purdie [this message]
2019-06-22  8:12   ` Richard Purdie
2019-06-22  9:27     ` Richard Purdie
2019-06-22 20:10   ` Jon Mason

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=30d4f80b522e6bcb23143a804eb44fc5067b3b47.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=jdmason@kudzu.us \
    --cc=openembedded-core@lists.openembedded.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox