jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/770088 )
Change subject: [tests] set noisysleep to inf during tests ......................................................................
[tests] set noisysleep to inf during tests
- the sleeping message isn't usefull during tests. Remove collecting it within script_tests.py - update doc for max_retries in tests/__init__.py
Change-Id: I34f21b77d3b515a35d7e1b84943622bebb2d1f71 --- M .appveyor.yml M .github/workflows/login_tests-ci.yml M .github/workflows/pywikibot-ci.yml M tests/__init__.py M tests/script_tests.py 5 files changed, 13 insertions(+), 20 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/.appveyor.yml b/.appveyor.yml index 6391b91..c3d815f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -78,6 +78,7 @@ - "mkdir %PYWIKIBOT_DIR%" - "python -Werror::UserWarning -m pwb generate_user_files -dir:%PYWIKIBOT_DIR% -family:wikipedia -lang:en -v -debug -user:%PYWIKIBOT_USERNAME%" - ps: "[IO.File]::AppendAllText($env:PYWIKIBOT_USER_CONFIG, 'max_retries = 2; maximum_GET_length = 5000; transliteration_target = None;')" + - ps: "[IO.File]::AppendAllText($env:PYWIKIBOT_USER_CONFIG, 'noisysleep = float('inf')')" - ps: "[IO.File]::AppendAllText($env:PYWIKIBOT_USER_CONFIG, 'usernames[''wikipedia''][''test''] = ''{0}'';' -f $env:PYWIKIBOT_USERNAME)" - ps: "[IO.File]::AppendAllText($env:PYWIKIBOT_USER_CONFIG, 'usernames[''wikidata''][''test''] = ''{0}'';' -f $env:PYWIKIBOT_USERNAME)" - ps: "[IO.File]::AppendAllText($env:PYWIKIBOT_USER_CONFIG, 'usernames[''commons''][''commons''] = ''{0}'';' -f $env:PYWIKIBOT_USERNAME)" diff --git a/.github/workflows/login_tests-ci.yml b/.github/workflows/login_tests-ci.yml index ebefc4b..14d46ff 100644 --- a/.github/workflows/login_tests-ci.yml +++ b/.github/workflows/login_tests-ci.yml @@ -101,6 +101,7 @@ echo "usernames['commons']['commons'] = '${{ env.PYWIKIBOT_USERNAME }}'" >> user-config.py echo "usernames['meta']['meta'] = '${{ env.PYWIKIBOT_USERNAME }}'" >> user-config.py echo "max_retries = 3" >> user-config.py + echo "noisysleep = float('inf')" >> user-config.py echo "maximum_GET_length = 5000" >> user-config.py echo "console_encoding = 'utf8'" >> user-config.py echo "import os" >> user-config.py diff --git a/.github/workflows/pywikibot-ci.yml b/.github/workflows/pywikibot-ci.yml index 55805e2..f7832bb 100644 --- a/.github/workflows/pywikibot-ci.yml +++ b/.github/workflows/pywikibot-ci.yml @@ -104,6 +104,7 @@ echo "usernames['commons']['commons'] = '${{ env.PYWIKIBOT_USERNAME }}'" >> user-config.py echo "usernames['meta']['meta'] = '${{ env.PYWIKIBOT_USERNAME }}'" >> user-config.py echo "max_retries = 3" >> user-config.py + echo "noisysleep = float('inf')" >> user-config.py echo "maximum_GET_length = 5000" >> user-config.py echo "console_encoding = 'utf8'" >> user-config.py echo "import os" >> user-config.py diff --git a/tests/__init__.py b/tests/__init__.py index 4f05ff9..4576123 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -268,17 +268,16 @@ lambda cls, *args: cls._make_dir(join_cache_path()))
-# Travis-CI builds are set to retry twice, which aims to reduce the number -# of 'red' builds caused by intermittent server problems, while also avoiding -# the builds taking a long time due to retries. -# The following allows builds to retry twice, but higher default values are -# overridden here to restrict retries to only 1, so developer builds fail more -# frequently in code paths resulting from mishandled server problems. -if config.max_retries > 2: +# Appveyor and Github action builds are set to retry twice or thrice, which +# aims to reduce the number of 'red' builds caused by intermittent server +# problems, while also avoiding the builds taking a long time due to retries. +# The following allows builds to retry up to three times, but higher default +# values are overridden here to restrict retries to only 1, so developer builds +# fail more frequently in code paths resulting from mishandled server problems. +if config.max_retries > 3: if 'PYWIKIBOT_TEST_QUIET' not in os.environ: - unittest_print( - 'tests: max_retries reduced from {} to 1' - .format(config.max_retries)) + unittest_print('tests: max_retries reduced from {} to 1' + .format(config.max_retries)) config.max_retries = 1
# Raise CaptchaError if a test requires solving a captcha diff --git a/tests/script_tests.py b/tests/script_tests.py index 245e491..c11c7d8 100644 --- a/tests/script_tests.py +++ b/tests/script_tests.py @@ -243,16 +243,7 @@
err_result = result['stderr'] out_result = result['stdout'] - - stderr_sleep, stderr_other = [], [] - for line in err_result.splitlines(): - if line.startswith('Sleeping for '): - stderr_sleep.append(line) - else: - stderr_other.append(line) - - if stderr_sleep: - unittest_print('\n'.join(stderr_sleep)) + stderr_other = err_result.splitlines()
if result['exit_code'] == -9: unittest_print(' killed', end=' ')
pywikibot-commits@lists.wikimedia.org