소스 검색

Add #339 to NEWS and add test.

Dan Helfman 4 년 전
부모
커밋
6f82c9979b
3개의 변경된 파일17개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 0
      NEWS
  2. 1 1
      setup.py
  3. 13 0
      tests/integration/test_execute.py

+ 3 - 0
NEWS

@@ -1,3 +1,6 @@
+1.5.9.dev0
+ * #339: Fix for intermittent timing-related test failure of logging function.
+
 1.5.8
  * #336: Fix for traceback when running Cronitor, Cronhub, and PagerDuty monitor hooks.
 

+ 1 - 1
setup.py

@@ -1,6 +1,6 @@
 from setuptools import find_packages, setup
 
-VERSION = '1.5.8'
+VERSION = '1.5.9.dev0'
 
 
 setup(

+ 13 - 0
tests/integration/test_execute.py

@@ -143,3 +143,16 @@ def test_log_outputs_with_no_output_logs_nothing():
     module.log_outputs(
         (process,), exclude_stdouts=(), output_log_level=logging.INFO, borg_local_path='borg'
     )
+
+
+def test_log_outputs_with_unfinished_process_re_polls():
+    flexmock(module.logger).should_receive('log').never()
+    flexmock(module).should_receive('exit_code_indicates_error').and_return(False)
+
+    process = subprocess.Popen(['true'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+    flexmock(process).should_receive('poll').and_return(None).and_return(0).twice()
+    flexmock(module).should_receive('output_buffer_for_process').and_return(process.stdout)
+
+    module.log_outputs(
+        (process,), exclude_stdouts=(), output_log_level=logging.INFO, borg_local_path='borg'
+    )