未验证 提交 f129471b 编写于 作者: Z Zeng Jinle 提交者: GitHub

Merge pull request #15083 from sneaxiy/fix_py_reader_unittest

Try to fix test_py_reader_use_executor.py
...@@ -209,6 +209,7 @@ class TestPyReaderUsingExecutor(unittest.TestCase): ...@@ -209,6 +209,7 @@ class TestPyReaderUsingExecutor(unittest.TestCase):
else: else:
thread = threading.Thread( thread = threading.Thread(
target=feed_data, args=(feed_queue, reader)) target=feed_data, args=(feed_queue, reader))
thread.daemon = True
thread.start() thread.start()
self.outputs = [] self.outputs = []
...@@ -219,6 +220,8 @@ class TestPyReaderUsingExecutor(unittest.TestCase): ...@@ -219,6 +220,8 @@ class TestPyReaderUsingExecutor(unittest.TestCase):
feed_queue.close() feed_queue.close()
self.validate() self.validate()
if not use_decorate_paddle_reader:
thread.join()
def validate(self): def validate(self):
self.assertEqual(len(self.inputs), len(self.outputs)) self.assertEqual(len(self.inputs), len(self.outputs))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册