Commit d72e5490 authored by Jason Madden's avatar Jason Madden

More tweaks for 3.7

parent f6daa504
...@@ -183,6 +183,23 @@ class TestFileObjectThread(ConcurrentFileObjectMixin, ...@@ -183,6 +183,23 @@ class TestFileObjectThread(ConcurrentFileObjectMixin,
def _getTargetClass(self): def _getTargetClass(self):
return fileobject.FileObjectThread return fileobject.FileObjectThread
def tearDown(self):
# Make sure outstanding tasks have completed.
# On Travis with Python 3.7 and libuv, test_bufsize_0
# fails in os.fdopen(), claiming the file descriptor is bad.
# This would happen if we closed (garbage collected?) a FD,
# opened a pipe and got the same int FD, and then some background
# task closed that same int FD again. FileObjectThread.close()
# goes through threadpool.apply(), which is supposed to be synchronous;
# make sure it is.
gevent.get_hub().threadpool.join()
# And collect any outstanding garbage, in case some resource is "leaking"
# (We have no indication that it is, but we're flailing wildly here to try
# to understand what could be happening)
gc.collect()
super(TestFileObjectThread, self).tearDown()
# FileObjectThread uses os.fdopen() when passed a file-descriptor, # FileObjectThread uses os.fdopen() when passed a file-descriptor,
# which returns an object with a destructor that can't be # which returns an object with a destructor that can't be
# bypassed, so we can't even create one that way # bypassed, so we can't even create one that way
...@@ -269,4 +286,5 @@ class TestTextMode(unittest.TestCase): ...@@ -269,4 +286,5 @@ class TestTextMode(unittest.TestCase):
if __name__ == '__main__': if __name__ == '__main__':
sys.argv.append('-v')
greentest.main() greentest.main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment