diff --git a/python/paddle/fluid/tests/unittests/test_py_reader_using_executor.py b/python/paddle/fluid/tests/unittests/test_py_reader_using_executor.py index d94494e219c5f348a08b4c3c2d111674ea6badf3..559386545e7304aab50043a64f7a89f48d7bbea9 100644 --- a/python/paddle/fluid/tests/unittests/test_py_reader_using_executor.py +++ b/python/paddle/fluid/tests/unittests/test_py_reader_using_executor.py @@ -209,6 +209,7 @@ class TestPyReaderUsingExecutor(unittest.TestCase): else: thread = threading.Thread( target=feed_data, args=(feed_queue, reader)) + thread.daemon = True thread.start() self.outputs = [] @@ -219,6 +220,8 @@ class TestPyReaderUsingExecutor(unittest.TestCase): feed_queue.close() self.validate() + if not use_decorate_paddle_reader: + thread.join() def validate(self): self.assertEqual(len(self.inputs), len(self.outputs))