← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~allenap/launchpad/rabbit-fixture-sigpipe into lp:launchpad

 

Gavin Panella has proposed merging lp:~allenap/launchpad/rabbit-fixture-sigpipe into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #788557 in Launchpad itself: "RabbitServer fixture not starting in buildbot: "Failed to create cookie file""
  https://bugs.launchpad.net/launchpad/+bug/788557

For more details, see:
https://code.launchpad.net/~allenap/launchpad/rabbit-fixture-sigpipe/+merge/64531

As suggested by lifeless, this branch follows the advice in http://bugs.python.org/issue1652 and sets the SIGPIPE handlers back to the default in the first forked child when spawning RabbitMQ. Let's see if it works.
-- 
https://code.launchpad.net/~allenap/launchpad/rabbit-fixture-sigpipe/+merge/64531
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~allenap/launchpad/rabbit-fixture-sigpipe into lp:launchpad.
=== modified file 'lib/lp/services/rabbit/testing/server.py'
--- lib/lp/services/rabbit/testing/server.py	2011-05-25 16:00:37 +0000
+++ lib/lp/services/rabbit/testing/server.py	2011-06-14 10:58:30 +0000
@@ -12,6 +12,7 @@
 import errno
 import os
 import re
+import signal
 import socket
 import subprocess
 import sys
@@ -92,6 +93,10 @@
     # print '## Starting', name, '##'
     os.setsid()
 
+    # Revert Python's handling of SIGPIPE. See
+    # http://bugs.python.org/issue1652 for more info.
+    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+
     # fork 2 - now detach once more free and clear
     pid = os.fork()
     if pid:

=== modified file 'lib/lp/services/rabbit/tests/test_fixture.py'
--- lib/lp/services/rabbit/tests/test_fixture.py	2011-05-26 10:44:17 +0000
+++ lib/lp/services/rabbit/tests/test_fixture.py	2011-06-14 10:58:30 +0000
@@ -58,10 +58,6 @@
 class TestRabbitFixture(TestCase):
 
     def test_start_check_shutdown(self):
-        # XXX: GavinPanella 2011-05-26 bug=788557 : Disabled due to spurious
-        # failures (cannot create cookie file).
-        self.skip("Disabled (bug 788557)")
-
         # Rabbit needs to fully isolate itself: an existing per user
         # .erlange.cookie has to be ignored, and ditto bogus HOME if other
         # tests fail to cleanup.