jenkins-bot has submitted this change and it was merged.

Change subject: Set max_retries=1 for test suite if greater than 2
......................................................................


Set max_retries=1 for test suite if greater than 2

Makes problems with tests more visible to developers.

Change-Id: Ib106ec42b0774ea6b0f8a2be5aa725f32a17f395
---
M tests/__init__.py
1 file changed, 11 insertions(+), 0 deletions(-)

Approvals:
  XZise: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/__init__.py b/tests/__init__.py
index b903565..a300ca7 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -43,6 +43,7 @@
 else:
     import unittest
 
+from pywikibot import config
 import pywikibot.data.api
 from pywikibot.data.api import Request as _original_Request
 from pywikibot.data.api import CachedRequest
@@ -183,6 +184,16 @@
     lambda *args: CachedRequest._make_dir(_cache_dir))
 
 
+# Travis-CI builds are set to retry twice, which aims to reduce the number
+# of 'red' builds caused by intermittant 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
+# overriden 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:
+    print('max_retries reduced from %d to 1 for tests' % config.max_retries)
+    config.max_retries = 1
+
 cache_misses = 0
 cache_hits = 0
 

-- 
To view, visit https://gerrit.wikimedia.org/r/166533
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib106ec42b0774ea6b0f8a2be5aa725f32a17f395
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: Nullzero <[email protected]>
Gerrit-Reviewer: XZise <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to