Page MenuHomePhabricator

test_query_modules is failing
Closed, ResolvedPublic

Description

https://ci.appveyor.com/project/Ladsgroup/pywikibot-g4xqx/build/job/yvvrjqu82idl5ycm#L4792

======================================================================
ERROR: test_query_modules (tests.api_tests.TestParaminfoModules)
Test loading all query modules.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\projects\pywikibot-g4xqx\pywikibot\data\api.py", line 1950, in submit
    body=body, headers=headers)
  File "c:\projects\pywikibot-g4xqx\pywikibot\tools\__init__.py", line 1520, in wrapper
    return obj(*__args, **__kw)
  File "c:\projects\pywikibot-g4xqx\pywikibot\comms\http.py", line 321, in request
    r = fetch(baseuri, method, params, body, headers, **kwargs)
  File "c:\projects\pywikibot-g4xqx\pywikibot\comms\http.py", line 521, in fetch
    error_handling_callback(request)
  File "c:\projects\pywikibot-g4xqx\pywikibot\comms\http.py", line 408, in error_handling_callback
    raise request.data
  File "c:\projects\pywikibot-g4xqx\pywikibot\comms\http.py", line 387, in _http_process
    **http_request.kwargs)
  File "c:\projects\pywikibot-g4xqx\env\lib\site-packages\requests\sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "c:\projects\pywikibot-g4xqx\env\lib\site-packages\requests\sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "c:\projects\pywikibot-g4xqx\env\lib\site-packages\requests\adapters.py", line 440, in send
    timeout=timeout
  File "c:\projects\pywikibot-g4xqx\env\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "c:\projects\pywikibot-g4xqx\env\lib\site-packages\urllib3\connectionpool.py", line 380, in _make_request
    httplib_response = conn.getresponse(buffering=True)
  File "c:\projects\pywikibot-g4xqx\env\lib\site-packages\vcr\stubs\__init__.py", line 232, in getresponse
    self.cassette.record_mode)
vcr.errors.CannotOverwriteExistingCassetteException: No match for the request (<Request (GET) https://en.wikipedia.org/w/api.php?modules=query%2Bgettingstartedgetpages%7Cquery%2Bglobalallusers%7Cquery%2Bglobalblocks%7Cquery%2Bglobalgroups%7Cquery%2Bglobalrenamestatus%7Cquery%2Bglobalusage%7Cquery%2Bglobaluserinfo%7Cquery%2Bimageinfo%7Cquery%2Bimages%7Cquery%2Bimageusage%7Cquery%2Binfo%7Cquery%2Biwbacklinks%7Cquery%2Biwlinks%7Cquery%2Blangbacklinks%7Cquery%2Blanglinks%7Cquery%2Blanglinkscount%7Cquery%2Blinks%7Cquery%2Blinkshere%7Cquery%2Blinterrors%7Cquery%2Blinterstats%7Cquery%2Blogevents%7Cquery%2Bmapdata%7Cquery%2Bmmsites%7Cquery%2Bmostviewed%7Cquery%2Bmystashedfiles%7Cquery%2Bnotifications%7Cquery%2Boath%7Cquery%2Boldreviewedpages%7Cquery%2Bores%7Cquery%2Bpageassessments%7Cquery%2Bpageimages%7Cquery%2Bpagepropnames%7Cquery%2Bpageprops%7Cquery%2Bpageswithprop%7Cquery%2Bpageterms%7Cquery%2Bpageviews%7Cquery%2Bprefixsearch%7Cquery%2Bprojectpages%7Cquery%2Bprojects%7Cquery%2Bprotectedtitles%7Cquery%2Bquerypage%7Cquery%2Brandom%7Cquery%2Breadinglistentries%7Cquery%2Brecentchanges%7Cquery%2Bredirects%7Cquery%2Breferences%7Cquery%2Brevisions%7Cquery%2Bsearch%7Cquery%2Bsiteinfo%7Cquery%2Bsiteviews&maxlag=5&action=paraminfo&format=json>) was found. Can't overwrite existing cassette ('c:\\projects\\pywikibot-g4xqx\\tests\\cassettes\\wikipedia.en/TestParaminfoModules.test_query_modules.yaml') in your current record mode ('once').
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "c:\projects\pywikibot-g4xqx\tests\api_tests.py", line 491, in test_query_modules
    self.site._paraminfo.fetch(self.site._paraminfo.query_modules)
  File "c:\projects\pywikibot-g4xqx\pywikibot\data\api.py", line 570, in fetch
    self._fetch(modules)
  File "c:\projects\pywikibot-g4xqx\pywikibot\data\api.py", line 646, in _fetch
    result = request.submit()
  File "c:\projects\pywikibot-g4xqx\pywikibot\data\api.py", line 2349, in submit
    self._data = super(CachedRequest, self).submit()
  File "c:\projects\pywikibot-g4xqx\pywikibot\data\api.py", line 1974, in submit
    self.wait()
  File "c:\projects\pywikibot-g4xqx\pywikibot\data\api.py", line 2203, in wait
    raise TimeoutError("Maximum retries attempted without success.")
pywikibot.exceptions.TimeoutError: Maximum retries attempted without success.
----------------------------------------------------------------------

https://ci.appveyor.com/project/Ladsgroup/pywikibot-g4xqx/build/job/1vhh32esd7f2i38m#L5457

======================================================================
ERROR: test_query_modules (tests.api_tests.TestParaminfoModules)
Test loading all query modules.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\projects\pywikibot-g4xqx\tests\api_tests.py", line 491, in test_query_modules
    self.site._paraminfo.fetch(self.site._paraminfo.query_modules)
  File "c:\projects\pywikibot-g4xqx\pywikibot\data\api.py", line 570, in fetch
    self._fetch(modules)
  File "c:\projects\pywikibot-g4xqx\pywikibot\data\api.py", line 646, in _fetch
    result = request.submit()
  File "c:\projects\pywikibot-g4xqx\pywikibot\data\api.py", line 2349, in submit
    self._data = super(CachedRequest, self).submit()
  File "c:\projects\pywikibot-g4xqx\pywikibot\data\api.py", line 1974, in submit
    self.wait()
  File "c:\projects\pywikibot-g4xqx\pywikibot\data\api.py", line 2203, in wait
    raise TimeoutError("Maximum retries attempted without success.")
TimeoutError: Maximum retries attempted without success.

Note: test_query_modules is recorded using vcrpy. (T184081)

Event Timeline

Dalba created this task.Mar 18 2018, 3:17 AM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptMar 18 2018, 3:17 AM
Dalba triaged this task as High priority.Mar 18 2018, 3:18 AM
Dalba updated the task description. (Show Details)Mar 18 2018, 3:21 AM
Dalba updated the task description. (Show Details)Mar 18 2018, 4:19 AM

Comparing the URL in CannotOverwriteExistingCassetteException message with the one stored in TestParaminfoModules.test_query_modules.yaml file shows gettingstartedgetpages as a newly added module (the date of failure matches the deployment of MW 1.31.0-wmf.25).

We might be able to fix this by manually modifying the yaml file, or updating the whole file, but I'm not sure if this is actually a good idea. The test should not fail every time a new module is activated on Wikimedia wikis.

Change 420240 had a related patch set uploaded (by Dalba; owner: Dalba):
[pywikibot/core@master] api_tests.py: Disable vcr on TestParaminfoModules

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

Change 420240 merged by jenkins-bot:
[pywikibot/core@master] api_tests.py: Disable vcr on TestParaminfoModules

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

Xqt closed this task as Resolved.Mar 18 2018, 11:41 AM
Xqt claimed this task.
Dalba claimed this task.Mar 18 2018, 2:22 PM
Dalba added a subscriber: Xqt.