Description

I'm currently in the process of fixing kleopatra's unit test suite. There is one
failing test that randomly fails with assertions in gpgme while running many
threaded keylistings and verify jobs.

To rule out that kleopatra or gpgme do something unsupported in their jobs I've
wrote a test for plain gpgme that duplicated the behavior.

First I just started 500 verify jobs this worked. So I added the mixed keylist /
verify mode that the kleopatra test used and this started to trigger bugs.

With a modified version that only does a keylist I can still trigger this but It
felt like more rarely and I never saw the io_select with that test. So I've
added both here.

The tests are quite aggressive with 500 threads I'm running them on an Intel
Core I7 2600k and they take quite a while. (Be sure to run them with nice)
I don't propose to add them to the regression test suite for the same reason ;-)

Here is an example of the errors I saw (running the tests ~10 times)
The most regular assertion is:

I can still see the asserts and segfaults when running the tests in gdb or with
logging enabled. So it's not a heisenbug ;-) (Although I was never able to get a
backtrace from kleopatras unit test. That test passed when running in gdb)