Page MenuHomePhabricator

test_preload_langlinks_normal of site_tests.TestPagePreloading sometimes fails
Closed, ResolvedPublic

Description

======================================================================
FAIL: test_preload_langlinks_normal (tests.site_tests.TestPagePreloading)
Test preloading continuation works.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/wikimedia/pywikibot/tests/site_tests.py", line 3278, in test_preload_langlinks_normal
    self.assertTrue(hasattr(page, '_langlinks'))
AssertionError: False is not true

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald Transcript
Xqt triaged this task as High priority.Nov 6 2019, 7:28 AM

Change 548957 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [tests] Use subTest to determine failing page

https://gerrit.wikimedia.org/r/548957

Same for tests.site_tests.TestPagePreloading testMethod=test_preload_templates

Change 548957 merged by jenkins-bot:
[pywikibot/core@master] [tests] Use subTest to determine failing page

https://gerrit.wikimedia.org/r/548957

test_preload_templates_and_langlinks sometimes also unexpectedly succeeds

Seems all tests are failing now due to this.

https://travis-ci.org/wikimedia/pywikibot/builds/622259729

And unfortunately subTest doesn't work with Pytest here and he don't get any hint.

I found two pages at en-wiki which doesn't has language links and cause this failure ( there are other pages at zh-wiki):

Probalbly _langlinks attribute is not been set.

There is no langlinks entry in api result if the page hasn't langlinks. Might be the api behaviour has been changed.
See https://en.wikipedia.org/w/api.php?action=query&titles=13th%20Regiment%20Armory&prop=langlinks

Change 555727 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] Test whether Main page has _langlinks preloaded

https://gerrit.wikimedia.org/r/555727

Change 555727 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] Ensure that required props exists as Page attribute

https://gerrit.wikimedia.org/r/555727