From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7206216186707574784 X-Received: by 2002:ac2:5109:0:b0:4d8:50e1:8ba7 with SMTP id q9-20020ac25109000000b004d850e18ba7mr2762416lfb.2.1678083162418; Sun, 05 Mar 2023 22:12:42 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:15a2:b0:4dd:8403:13fe with SMTP id bp34-20020a05651215a200b004dd840313fels135497lfb.3.-pod-prod-gmail; Sun, 05 Mar 2023 22:12:40 -0800 (PST) X-Google-Smtp-Source: AK7set8SWHwfLdVF2HGA1p1askIi9NkLi+JdMcouLVPV/W7kToRt1EJLQYQWSPK83rcHGHJJwDKh X-Received: by 2002:ac2:46d6:0:b0:4da:f436:d423 with SMTP id p22-20020ac246d6000000b004daf436d423mr2664585lfo.21.1678083160676; Sun, 05 Mar 2023 22:12:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678083160; cv=none; d=google.com; s=arc-20160816; b=mV/zdPb160GL+CrIp23j5A/F+u19ns/4Bmbp7Y0xM/eZu2s5JlCQ4hLhTYvDUOs2eC GhnwWUXGSyRkTtsGm6CRx1ZvqkXZJQZJTLNO1ZB6cpEgNGpfvJlko7Ozcc3NoLKlO9OF ZL8UtihcRZBulOAwLgczhmze7zxnfcS6k0BKUHbrtWsHsvwiAkQZn2Fo0mAMuyW7rAMT vhiGxnAdEJRDGZ6zxy55iA+aq5u0WwbhEYjSSl/TDw6cS8P/k5G68TEPi4xa2E8eunKY q7OXAuBZgruhdxVsr/R4T7w5RSO2ZFWMwV9fMHoAq+GGVoXoHhDzq/LE4U8Okqtb8oIK MVuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=nnnCnYbHZyn9mC91Eg1Nbv9wb27roXZHrWOrk2yQV0s=; b=pNszYWRcqZKfD/hXUX/t9vt/H6W+qzHl+Qy8xtBxM5GKmQFkZEIWxK7ptKkV/Uw2G8 IMRjXDPBsb+U1TzC3lEpDGIN8ANV+hdyv1TnfVqzio+QB9bU8CxqL0N2bYKP+dLopQ4k C6dJCYZIRSBx9iwd5a45R8KwVYVhdoH+aw14rdooJTgqPEB9Bu3+n3Mq5IwZqZBUgCTH mEwNzM6p14oc4F9jmCTLtcJppcaXN1xnkvwBxlCf3MdDBnt2/+gqZEZU+MFh6mAOJrgj tNI4GOSWDGCx1Wh1V89h+kv1gZw6wmuQ7f97knG5252956RLRS4I+Kog7NvFDwfacMIY Zceg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id i2-20020a0565123e0200b004dc4c4ff7dcsi442959lfv.2.2023.03.05.22.12.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 05 Mar 2023 22:12:40 -0800 (PST) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from home.localnet (44-208-124-178-static.mgts.by [178.124.208.44] (may be forged)) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 3266CdHq014337 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 6 Mar 2023 07:12:39 +0100 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: Re: [PATCH] testsuite: Cleanup after gpg import in repro_test Date: Mon, 06 Mar 2023 09:12:42 +0300 Message-ID: <21248720.4csPzL39Zc@home> In-Reply-To: <2173862.hkbZ0PkbqX@hp> References: <20230303071907.3346-1-ubely@ilbers.de> <20230303101056.3bef674c@md1za8fc.ad001.siemens.net> <2173862.hkbZ0PkbqX@hp> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: IjpP7zz0SL5o In the email from Friday, 3 March 2023 16:57:27 +03 user Uladzimir Bely wrote: > In mail from Friday, 3 March 2023 12:10:56 +03 user Henning Schild wrote: > > Am Fri, 3 Mar 2023 08:19:07 +0100 > > > > schrieb Uladzimir Bely : > > > After each repro_test a random GNUPGHOME directory and `gpg-agent` > > > process are left. > > > > > > After multiple full tests in CI we may come to the situation when > > > all inotify descriptors are busy: > > > > > > ``` > > > File "/bitbake/lib/pyinotify.py", line 1728, in _init_ > > > > > > raise OSError(err % self._inotify_wrapper.str_errno()) > > > > > > OSError: Cannot initialize new instance of inotify, > > > > > > Errno=Too many open files (EMFILE) > > > > > > ``` > > > > > > This patch provides an appropriate cleanup routine. > > > > > > Signed-off-by: Uladzimir Bely > > > --- > > > > > > testsuite/cibase.py | 7 ++++++- > > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > > > diff --git a/testsuite/cibase.py b/testsuite/cibase.py > > > index f2e4e957..7ac8ebc7 100755 > > > --- a/testsuite/cibase.py > > > +++ b/testsuite/cibase.py > > > @@ -3,6 +3,7 @@ > > > > > > import glob > > > import os > > > import re > > > > > > +import shutil > > > > > > import tempfile > > > import time > > > > > > @@ -35,7 +36,7 @@ class CIBaseTest(CIBuilder): > > > os.chdir(self.build_dir) > > > > > > - os.environ['GNUPGHOME'] = tempfile.mkdtemp() > > > + os.environ['GNUPGHOME'] = gnupg_home = tempfile.mkdtemp() > > > > > > result = process.run('gpg --import %s %s' % (gpg_pub_key, > > > > > > gpg_priv_key)) > > > > > > if result.exit_status: > > > @@ -56,6 +57,10 @@ class CIBaseTest(CIBuilder): > > > self.configure(**kwargs) > > > self.bitbake(targets, **kwargs) > > > > > > + # Cleanup > > > + process.run('gpgconf --kill gpg-agent') > > > + shutil.rmtree(gnupg_home, True) > > > > Does that really always run? We have a self.fail('GPG import failed'), > > if that returns from this function we might have agents around, and > > that directory. > > > > I'm not sure gpg-agent process will be start in this case, but yes, at least > temporary directory will remain. On the other hand, having this undeleted > might be helpful for debugging... > > > > > the tearDown() fixture might be better > > Henning > > Do you mean just a separate function that executed from 2 places? Or is it > some kind a method that run automatically? > > P.S. Walked through avocado documentation while writing this mail and found > that it's a method that runs automatically. Will try with this approach, > thanks for the hint. > After examining this and discussing internally, we decided to leave it as is. To tearDown here the test should be completely rewritten (at least, moving tmdirs creations to the top level of test (e.g, "setUp" routing), since repro test does "gpg import" twice and requires two different gpg-agent processes to kill. Will leave it as is for now. > > > > > + > > > > > > def perform_ccache_test(self, targets, **kwargs): > > > def ccache_stats(dir, field): > > > # Look ccache source's 'src/core/Statistic.hpp' for > > > > > > field meanings > > > > >