Browse Source

[1275] restore the finally statement in run function in the MockMsgq class.
As a result of considering any other situation where self.msgq.run() in the
try statement is accidentally failed. This changes don't affect the result of
the unittest.

Naoki Kambe 13 years ago
parent
commit
8b024ff407
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/bin/stats/tests/test_utils.py

+ 5 - 0
src/bin/stats/tests/test_utils.py

@@ -101,6 +101,11 @@ class MockMsgq:
             self.msgq.run()
         except Exception:
             pass
+        finally:
+            # explicitly shut down the socket of the msgq before
+            # shutting down the msgq
+            self.msgq.listen_socket.shutdown(msgq.socket.SHUT_RDWR)
+            self.msgq.shutdown()
 
     def shutdown(self):
         # do nothing