public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] testsuite: Cleanup after gpg import in repro_test
@ 2023-03-03  7:19 Uladzimir Bely
  2023-03-03  9:10 ` Henning Schild
  2023-03-06  6:12 ` Uladzimir Bely
  0 siblings, 2 replies; 5+ messages in thread
From: Uladzimir Bely @ 2023-03-03  7:19 UTC (permalink / raw)
  To: isar-users

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 "<path>/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 <ubely@ilbers.de>
---
 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
-- 
2.20.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-06  6:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-03  7:19 [PATCH] testsuite: Cleanup after gpg import in repro_test Uladzimir Bely
2023-03-03  9:10 ` Henning Schild
2023-03-03 13:57   ` Uladzimir Bely
2023-03-06  6:12     ` Uladzimir Bely
2023-03-06  6:12 ` Uladzimir Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox