#962022 mono: debian/rules: test suite arbitrarily kills mono processes

Package:
src:mono
Source:
mono
Submitter:
Vagrant Cascadian
Date:
2025-08-24 22:39:01 UTC
Severity:
important
#962022#5
Date:
2020-06-02 04:58:04 UTC
From:
To:
I noticed when I build mono multiple times conurrently, often times the
builds fail right as the first build is running the test suite.

I think this is because of:

$ grep KILL_MONO debian/rules
KILL_MONO = pgrep mono | xargs kill -9
        MINI_TEST = cd mono/mini && $(TIMEOUT) make check; $(KILL_MONO)
        MONO_BOEHM_TEST = cd mono/tests && MONO_ENV_OPTIONS=--gc=boehm
        $(TIMEOUT) make check; $(KILL_MONO)
        MONO_SGEN_TEST = cd mono/tests && MONO_ENV_OPTIONS=--gc=sgen
        $(TIMEOUT) make check; $(KILL_MONO)
        -$(KILL_MONO)

It just kills any mono processes it can find, including processes
unrelated to the running build.

Thanks for maintaining mono!

live well,
  vagrant

#962022#14
Date:
2025-08-24 22:37:04 UTC
From:
To:
The initial kill call (actually a killall call at that point in time,
replaced with pgrep + kill later) was added more than ten years ago:

    Hard kill stray mono processes after each test pass to make the life of buildd admins nicer

diff --git a/debian/rules b/debian/rules
index 48df8d9b5c..f5622f8c87 100755
--- a/debian/rules
+++ b/debian/rules
@@ -56,9 +56,10 @@ ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
     MONO_SGEN_TEST = true
 else
     TIMEOUT = timeout -k 1h 1h
-    MINI_TEST = cd mono/mini && $(TIMEOUT) make check
-    MONO_BOEHM_TEST = cd mono/tests && MONO_ENV_OPTIONS=--gc=boehm $(TIMEOUT) make test
-    MONO_SGEN_TEST = cd mono/tests && MONO_ENV_OPTIONS=--gc=sgen $(TIMEOUT) make test
+    KILL_MONO = killall -9 mono
+    MINI_TEST = cd mono/mini && $(TIMEOUT) make check; $(KILL_MONO)
+    MONO_BOEHM_TEST = cd mono/tests && MONO_ENV_OPTIONS=--gc=boehm $(TIMEOUT) make test; $(KILL_MONO)
+    MONO_SGEN_TEST = cd mono/tests && MONO_ENV_OPTIONS=--gc=sgen $(TIMEOUT) make test; $(KILL_MONO)
 endif
 ifeq ($(DEB_BUILD_ARCH), powerpc)
     MONO_SGEN_TEST = true
-----

Hopefully this is no longer required, I am going to run some tests with
this call removed and see if I end up with rogue mono processes (keeping
in mind that my tests are run in sbuild, I don’t know how it deals with
such unending processes).

If I notice no such lingering processes, then the next src:mono upload
is going to ship without that pgrep+kill call, and as such should stop
killing unrelated processes.