mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Don't error out because of bad file descriptor errors
This commit is contained in:
parent
102d63e238
commit
5ed3d8d98c
@ -6,6 +6,8 @@
|
||||
# Import python libs
|
||||
from __future__ import absolute_import
|
||||
import os
|
||||
import errno
|
||||
import socket
|
||||
import logging
|
||||
|
||||
import tornado.gen
|
||||
@ -49,7 +51,12 @@ class BaseIPCReqCase(tornado.testing.AsyncTestCase):
|
||||
def tearDown(self):
|
||||
super(BaseIPCReqCase, self).tearDown()
|
||||
#failures = []
|
||||
self.server_channel.close()
|
||||
try:
|
||||
self.server_channel.close()
|
||||
except socket.error as exc:
|
||||
if exc.errno != errno.EBADF:
|
||||
# If its not a bad file descriptor error, raise
|
||||
raise
|
||||
os.unlink(self.socket_path)
|
||||
#for k, v in six.iteritems(self.io_loop._handlers):
|
||||
# if self._start_handlers.get(k) != v:
|
||||
@ -89,7 +96,12 @@ class IPCMessageClient(BaseIPCReqCase):
|
||||
|
||||
def tearDown(self):
|
||||
super(IPCMessageClient, self).tearDown()
|
||||
self.channel.close()
|
||||
try:
|
||||
self.channel.close()
|
||||
except socket.error as exc:
|
||||
if exc.errno != errno.EBADF:
|
||||
# If its not a bad file descriptor error, raise
|
||||
raise
|
||||
|
||||
def test_basic_send(self):
|
||||
msg = {'foo': 'bar', 'stop': True}
|
||||
|
Loading…
Reference in New Issue
Block a user