Open heartsucker opened 5 years ago
This is not happening anymore: at the end of the tests, no gpg2
processes are running.
Might have been fixed as a side-effect of the changes in https://github.com/freedomofpress/securedrop/pull/5683 and https://github.com/freedomofpress/securedrop/pull/6184 , which reduce the number of gpg2
processes spawned by the test suite to 1, and use yield
in the GPG fixture.
Description
While running the test suite, the test suite calls many times to
gpg2
each with its owngpg-home
directory. This causes many instances ofgpg-agent
to spawn. These processes are not killed and by the end of a run of the test suite, there are over 80 processes that are left around. When the container exists, these processes are killed, but they take up some amount of memory and resources. This is annoying when using a dev shell and repeatedly running sections of the test suite as it will leave hundreds of processes around if they are not manually cleaned up.Steps to Reproduce
./bin/dev-shell
./bin/run-test -vv tests/test_*.py
pgrep gpg-agent | wc -l
Expected Behavior
The number of
gpg-agent
processes is 0 at the end of the tests.Actual Behavior
The number is over 80.
Comments
The
pytest
fixture that callsgpg2
shouldyield
it's fixture object and then attempt to clean up the dangling process. An example of this is in #4312.