From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7206216186707574784 X-Received: by 2002:a81:af4e:0:b0:521:db3f:9e27 with SMTP id x14-20020a81af4e000000b00521db3f9e27mr1006854ywj.2.1677851855031; Fri, 03 Mar 2023 05:57:35 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a25:3ac2:0:b0:96a:e104:c030 with SMTP id h185-20020a253ac2000000b0096ae104c030ls1941578yba.11.-pod-prod-gmail; Fri, 03 Mar 2023 05:57:34 -0800 (PST) X-Google-Smtp-Source: AK7set+eBfk+p8ByvkoUdwJ0t1HQA/FU+LYbia4F/PLB9jYoht2TAR1Kbta3gsbQYTajKCvyRzvB X-Received: by 2002:a05:6902:28c:b0:a2c:77db:d465 with SMTP id v12-20020a056902028c00b00a2c77dbd465mr1337521ybh.62.1677851854281; Fri, 03 Mar 2023 05:57:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677851854; cv=none; d=google.com; s=arc-20160816; b=m2Z8gKqIExTBcnvEoywl0I8xsoISDcYQbD55vuHmm/ndRrPy5S2zuyrvePsR5frfT9 AIYJxgkuJghMhst8CtNpR0WUoNQ6ZBM1a4IidvLacWsVvb6zsZyafbfg2gPQJyqr8ehz gw5dPKfCP0iQHncG2L2r/X7tgW7U3i0LvWE6UNyPZzfCmeQ0NYbcblMz+XWgeRXb7Fwo 44LKMwasjnlrIFNaR7xcRDs83WGLwiV4HRr7QmTQN5/cIxb6rT1H3IuKQFErk6fq4Cqp M9Y31Xj6YTzbKKbmb23YVOp0dn5FFdJHxZPzISyNQi7xTI+lGo6BTixHUpHPUV/j0VLL 0pZw== 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:cc:to:from; bh=/L35HVWGhxkQeFFFrA2BxSlKzlDnHnUco1Agb+Iv4pQ=; b=S1kdTe8iGINK+3/ubw7N6hShX93T5nHO+NWZXriSHFaVKNmkUHVBo/68W+O9F088MG kytjMJ21shyBIw50qY3gevIMArmMBLSSZO/bj/c+WYqk+osFy8UDwCYpIRSFNn/hHFBz VEplyvJxgTuYzsLObBawbHkVr4OQ1RfxH4s+OJMe/XIHPJogQlvRczmOSP36ASSYkHlz hmfW+5PLwXzHnqEyJuMLUGJq/kDBBjAKSwUzbVJZ4gprpIQGFz335qpPfzRtNZJE3aGV eGC+Qfh1aoGyKN/7HcddbFM1h62za5igOFRuAARu+RuF67gwLnZkhEJO0TTF2Ug3D+9t Xv7A== 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 f62-20020a251f41000000b0094a9375ec94si127134ybf.1.2023.03.03.05.57.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Mar 2023 05:57:34 -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 hp.localnet (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 323DvRRg029008 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 3 Mar 2023 14:57:28 +0100 From: Uladzimir Bely To: Henning Schild Cc: isar-users@googlegroups.com Subject: Re: [PATCH] testsuite: Cleanup after gpg import in repro_test Date: Fri, 03 Mar 2023 16:57:27 +0300 Message-ID: <2173862.hkbZ0PkbqX@hp> In-Reply-To: <20230303101056.3bef674c@md1za8fc.ad001.siemens.net> References: <20230303071907.3346-1-ubely@ilbers.de> <20230303101056.3bef674c@md1za8fc.ad001.siemens.net> 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: HO4RUWHqGoAH 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. > > > + > > > > def perform_ccache_test(self, targets, **kwargs): > > def ccache_stats(dir, field): > > # Look ccache source's 'src/core/Statistic.hpp' for > > > > field meanings