ubuntu-image haschangelog tests fail due to github API rate limit exceeded

Bug #1690081 reported by Łukasz Zemczak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Image
Fix Released
Medium
Łukasz Zemczak

Bug Description

In some recent autopkgtest runs for github PRs haschangelog test failures can be noticed that aren't actually related to real failures:

Traceback (most recent call last):
  File "/tmp/autopkgtest.SR9yz2/build.MWN/ubuntu-image/debian/tests/haschangelog", line 31, in <module>
    pull = remote.get_pull(pr_number)
  File "/usr/lib/python3/dist-packages/github/Repository.py", line 1655, in get_pull
    self.url + "/pulls/" + str(number)
  File "/usr/lib/python3/dist-packages/github/Requester.py", line 171, in requestJsonAndCheck
    return self.__check(*self.requestJson(verb, url, parameters, headers, input, cnx))
  File "/usr/lib/python3/dist-packages/github/Requester.py", line 179, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.GithubException: 403 {'documentation_url': 'https://developer.github.com/v3/#rate-limiting', 'message': "API rate limit exceeded for 91.189.89.216. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)"}

It seems like the autopkgtest infra is doing too many API calls in the selected time frame which in turn causes the test to fail. From our POV we're actually only doing two real github API calls, so probably there are some other tests that also use the same thing. One possible action would be to make the test-case wait and retry in such a case, but this would mean at the worst case the test to take over an hour.
Another solution would be to check if we can bump the rate limit (authenticating somehow?).

Changed in ubuntu-image:
milestone: none → 1.4
tags: added: id-5a38e6dc4fe1bdb99a5fb640
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

I have prepared a workaround - it looks like just using the https API pages directly doesn't trigger API limits - at least that's what I noticed so far.

https://github.com/CanonicalLtd/ubuntu-image/pull/152

We can always re-open if this seems like not the right workaround.

Changed in ubuntu-image:
status: New → In Progress
Changed in ubuntu-image:
status: In Progress → Fix Committed
Changed in ubuntu-image:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.