valhallasw added a comment.

No, of course it's not about the lines in between, but the time in between. And time does depend on the code executed, mostly because that code typically also performs more API requests.

In this specific case it won't help much (because the different pagetemplates calls are quite close already), but this is also a rare case. The situation with pagelinks is not that there are two requests close together in one test function, but rather there are many calls all around the test suite. The time between the first request (which is then cached) and the test becomes quite large and it's therefore more likely to trigger the race condition.

In any case, not caching everything in Travis makes reasoning a lot easier. For example, https://gerrit.wikimedia.org/r/#/c/356835/3/tests/site_tests.py reduces to something along the lines of

all_templates = mysite.pagetemplates(mainpage)
ns10_templates = mysite.pagetemplates(mainpage, namespaces=[10])
if (all_templates == mysite.pagetemplates(mainpage)):
    self.assertIsSubsetOf(ns10_templates, all_templates)


TASK DETAIL
https://phabricator.wikimedia.org/T153501

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: valhallasw
Cc: valhallasw, Dalba, gerritbot, pywikibot-bugs-list, Aklapper, jayvdb, Magul, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, Tbscho, MayS, Lewizho99, Mdupont, JJMC89, Maathavan, Avicennasis, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to