googlefonts / diffbrowsers

Apache License 2.0
8 stars 5 forks source link

Error In browserstack_screenshots: InvalidRequestError() takes no keyword arguments #24

Open graphicore opened 4 years ago

graphicore commented 4 years ago

I had this error in the google/fonts QA Travis CI: https://github.com/google/fonts/pull/2526#issuecomment-652125631

@m4rc1e FIY QA keeps failing here, first try failed as a Travis timeout while in diffbrowsers.

Now, the second try fails as: TypeError: InvalidRequestError() takes no keyword arguments https://travis-ci.org/github/google/fonts/builds/703740233#L3446-L3465:

INFO:diffbrowsers.screenshot:Taking screenshot for url: http://35.238.63.0/screenshot/ebaf1a53-de8a-49ee-b75e-c3d50fca3e64/waterfall/before?styles=Bold,Regular
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.7.1/bin/gftools-qa.py", line 549, in <module>
    main()
  File "/home/travis/virtualenv/python3.7.1/bin/gftools-qa.py", line 528, in main
    qa.googlefonts_new()
  File "/home/travis/virtualenv/python3.7.1/bin/gftools-qa.py", line 282, in googlefonts_new
    self.browser_previews()
  File "/home/travis/virtualenv/python3.7.1/bin/gftools-qa.py", line 271, in browser_previews
    diff_browsers.diff_view("waterfall", styles=name_group)
  File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/diffbrowsers/diffbrowsers.py", line 83, in diff_view
    self.screenshot.take(before_url, before_path)
  File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/diffbrowsers/screenshot.py", line 20, in take
    generate_resp_json = self.generate_screenshots()
  File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/browserstack_screenshots/__init__.py", line 86, in generate_screenshots
    resp = self._process_response(resp)
  File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/browserstack_screenshots/__init__.py", line 57, in _process_response
    raise InvalidRequestError(**json.loads(req.content))
TypeError: InvalidRequestError() takes no keyword arguments
The command "bash .ci/run.sh" exited with 1.

And today @vv-monsalve reported this to me happening in Font Bakery Dashboard: https://fontbakery.graphicore.de/dispatcher/process/569afe17-e0e1-42c0-ba53-6c400d4a63be

(got to scroll down to "Task: BrowsersDiffsAndPreviews")

m4rc1e commented 4 years ago

Thanks. I'll take a look.

m4rc1e commented 4 years ago

I'm now hitting the same error. I'll see if the apis have changed.

m4rc1e commented 4 years ago

Just done some digging and here's the response I get back from browserstack

{"message":"Parallel limit reached","running_sessions":5}

It seems that browserstack is choking on 3 ongoing requests. I've tried to cancel these so let's see what happens.

Imo, we shouldn't be using pybrowserstack-screenshots. This dependency is old (still py2 for the most part) and its error handling is broken (Exceptions do not output the responses correctly). We should roll our own or just play with the api directly.

m4rc1e commented 4 years ago

Both of our accounts are having the same issue. It may be that Browserstack Screenshots is down. I'll send them a mail.

For the time being, let's not use diffbrowsers. If you're using gftools qa, you'll need to enter each tool manually e.g

gftools qa -f fonts.ttf -gfb --fontbakery --diffenator --plot-glyphs -o ~/Desktop/font_out_qa

cc @vv-monsalve @graphicore

graphicore commented 4 years ago
raise InvalidRequestError(**json.loads(req.content))
TypeError: InvalidRequestError() takes no keyword arguments

Well, the request was invalid, but in the browserstack_screenshots package InvalidRequestError is called the wrong way, hence, we can't see the actual error. :-(

m4rc1e commented 4 years ago

Well, the request was invalid, but in the browserstack_screenshots package InvalidRequestError is called the wrong way, hence, we can't see the actual error. :-(

Yep. I only got the response myself because I added an adhoc print statement into the module.

graphicore commented 4 years ago

Just done some digging and here's the response I get back from browserstack

...

Yep. I only got the response ...

Uh, sorry I missed that post. :-)

graphicore commented 4 years ago

It seems that browserstack is choking on 3 ongoing requests. I've tried to cancel these so let's see what happens.

I suspect that would be from the first QA job I sent via https://github.com/google/fonts/pull/2526 . I wrote:

first try failed as a Travis timeout while in diffbrowsers.

Maybe something in the Kumbh Sans font is off. :thinking:

We should roll our own or just play with the api directly.

I agree, using abstraction to access an API makes it just harder to react on changes or problems, despite of being initially quicker to implement.

m4rc1e commented 4 years ago

Maybe something in the Kumbh Sans font is off. 🤔

Fonts are fine. GF Regression successfully loaded the fonts.

We have two browserstack accounts and both have crashed. I reckon the issue is with Browserstack itself.

vv-monsalve commented 4 years ago

Thanks @graphicore, and @m4rc1e

It seems that browserstack is choking on 3 ongoing requests. I've tried to cancel these so let's see what happens.

The first time I received the Error it only generated the folder for the Bold weight containing only a plot glyphs png. The second time it generated only the "Light" folder. So yes, I think it might be the case https://fontbakery.graphicore.de/dispatcher/process/f955fc55-e804-4d7d-8227-ec81093c5bfe

Fonts are fine. GF Regression successfully loaded the fonts.

The above would support this, I think

For the time being, let's not use diffbrowsers. If you're using gftools qa, you'll need to enter each tool manually e.g

Thanks I'll do so.