#759496 mono: build kills unrelated processes: pgrep mono | xargs kill -9

#759496#5
Date:
2014-08-27 17:33:17 UTC
From:
To:
From a Mono build log:

cd mono/tests && MONO_ENV_OPTIONS=--gc=sgen timeout -k 1h 1h make test; pgrep mono | xargs kill -9

This can unceremoniously kill unrelated mono processes, e.g. SparkleShare.

    S

#759496#16
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.