From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7206216186707574784 X-Received: by 2002:a05:6000:1212:b0:2c7:e60:abe3 with SMTP id e18-20020a056000121200b002c70e60abe3mr2874789wrx.6.1678083173074; Sun, 05 Mar 2023 22:12:53 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:600c:3ca8:b0:3cf:72dc:df8 with SMTP id bg40-20020a05600c3ca800b003cf72dc0df8ls6267743wmb.0.-pod-canary-gmail; Sun, 05 Mar 2023 22:12:51 -0800 (PST) X-Google-Smtp-Source: AK7set+lrv7YSpq9kKxxejtHKsVH4NZtJrkEOyhDHvMDHV/U9VKTaUjdOTmPj10k+xcJSTiopDPp X-Received: by 2002:a05:600c:4591:b0:3da:2a78:d7a4 with SMTP id r17-20020a05600c459100b003da2a78d7a4mr7790523wmo.21.1678083171575; Sun, 05 Mar 2023 22:12:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678083171; cv=none; d=google.com; s=arc-20160816; b=NaEKA++qo3m6JV69fkjQ7SkncJvlaneQ9G7MkCDJQbAqjy9ZJNnrpW95/QHOg1ug16 BQB+gosjy7hX3FQalCYRunBZq8947t2l0y46gG3xecJ6onlkn4D8TWwWQz1ft5u6jp8e TZv9IHuMAFu7/3ps3pFPpQK5HgrpZqYj7Y7zq05PLelJL//O5Bvk0Fx4Ixw00YBviuTG 3jXDh850lpIbUjwv/GzH/uVOFp+qq8Ol8V8JlYDrLpPS8iN5IabL4dV2TJQ9co73U8AJ 4t63DKhneo33O9d6jNPs5kOdsWzeP3hkptSUI+c4S1WQUDrX9GwSNWFIs/Ye2dbUmWUe kLbA== 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=ZzkhLaZSKedSQiTTNuzXdhcFqSdzsBgrKlkBfHhsEy8=; b=kFQZFx0lht98lNm5OPU7uvvUD2Nk+kvT4Gqm2HEwTIDnWxT8220OIl7zu0q5lFxfp8 eTQHVBiXOw+S0QcqoaPEKX8QoQMMPzmjmdiqtd+PKa6ZF1E8LWN+H5Eg8cD/hR+k7BXQ fuNBq7oQpBe1PDXv/qlJgHQx1tJ3jGA8AUVeD/FwsLkDyRtPaLSUXOv0EPBaebsiuvig 1bdDQ/k1EM8ForNAzDpH3jKA4+WhFBpa8f85Hf/Iy8xc0IHvjcJyjGcoYMnoh13wUtWm 50cVYZjCpiBcocKK22JtZ5NnCD5IT7fYyM87VlPvPLEDPEOT9JPXDnKB9LzHiMdNiWRM MNbA== 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 h10-20020a05600c314a00b003db110e1928si423723wmo.1.2023.03.05.22.12.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 05 Mar 2023 22:12:51 -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 3266Co0p014345 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 6 Mar 2023 07:12:50 +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:53 +0300 Message-ID: <4287985.UPlyArG6xL@home> In-Reply-To: <20230303071907.3346-1-ubely@ilbers.de> References: <20230303071907.3346-1-ubely@ilbers.de> 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: CTP3QWm+jLuQ In the email from Friday, 3 March 2023 10:19:07 +03 user Uladzimir Bely wrote: > 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) > + > def perform_ccache_test(self, targets, **kwargs): > def ccache_stats(dir, field): > # Look ccache source's 'src/core/Statistic.hpp' for field meanings > Applied to next.