Add #339 to NEWS and add test.

This commit is contained in:
Dan Helfman 2020-07-07 22:31:17 -07:00
parent 0a659a397f
commit 6f82c9979b
3 changed files with 17 additions and 1 deletions

3
NEWS
View file

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

View file

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

View file

@ -143,3 +143,16 @@ def test_log_outputs_with_no_output_logs_nothing():
module.log_outputs( module.log_outputs(
(process,), exclude_stdouts=(), output_log_level=logging.INFO, borg_local_path='borg' (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'
)