BackstopJS: Intermittent Failures
Hey all, We’re hitting intermittent bumps in our chromy-based backstop suite.
On a semi-regular basis we get false failures of this:
compare | Chromy error: Error. See scenario – xxx xxx xxx xxx
Accompanied by a report that looks like this:

We’ve played with asyncCapture/compare limit, played with delay, but no dice. Sometimes it can be resolved by pkill Chrome, but generally we’re struggling to find the special sauce to solve them for good.
First question - have you encountered these intermittent failures?
Second question - Is there a chromy/backstop flag we can set to investigate the error or capture some more context around this Chromy error?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 38 (21 by maintainers)
Alright, good news guys. That seemed to be our issue. We added
wait(<selector>)to all of our DOM interactions and we’ve run our suite 15+ times with"asyncCaptureLimit": 20. All clear!Here are the guts of our solution if you’re interested.
We have a helper script in which we introduced two functions for
click()andtype():And then in our
onReadyScript:A few chromy/backstop tweaks helped us debug this work:
onReadyScripttoo)reject(new WaitTimeoutError('...'))- we added the selector on which we were waiting. In a few of our scenarios we discovered we had bogus selectors that were never working in the first place, so our test was timing out.Hope this helps others with the same issue!
@kiran-redhat – thank you for tracking this down! I completely agree with your idea. We should add a log.error at line 319 which also includes the scenario label+viewport. This would make debugging MUCH easier for engineers!
@garris Regarding @joseph-stano OP, I modified backstop source in
node_moduleslike you mentioned and received the following error for every one of our tests that result in the white diff for all 3 images as in the OP screenshot.Do you have any tips on how we can learn more about what file
anonymousis, or perhaps whatinjectedScriptIdis pointing to? I’ve removed all instances offocusfrom our code base and still receive the errors consistently.Also, I set
asyncCaptureLimitto 1. Instead of getting a third of the tests erroring, I only got one that errored. It errored with the same error message directly above.