Closed cancan101 closed 2 years ago
Hey @cancan101! 👋
Logs starting with [percy:client]
come from API communications. Those logs specifically come after a snapshot's resources are uploaded to the API. If the process is truly hanging there, execute
hooks shouldn't have an effect since they are run before a snapshot is captured (therefore before being uploaded).
It could still be hanging because of the long waits, but those client logs don't seem to be relevant to how/where. Does it hang for a specific snapshot, any snapshot, or only when handling multiple snapshots? If you can narrow it down further and/or provide a reproduction so we can get a better look at the logs, that would help figure out if this is a regression or an edge case and how exactly we should address it.
Is there any possibility of a race, i.e. in the case that the execute
for a given page / snapshot takes a very long time to run?
This issue is stale because it has been open for more than 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.
Sorry if this is not helpful, but I had a similar issue with @percy/cypress
and in my case the root cause was a Promise in one of my custom Cypress commands that was not being resolved. Cypress was just sitting and waiting for the bugged Promise to resolve while meanwhile the test had already completed and the snapshot had already been finalized.
Obviously this is not going to be the same exact issue, but I suspect the fundamentals may be the same, i.e. the runtime is waiting for some Promise to resolve and that's not happening. Curious what would happen if this execute.afterNavigation
code was rewritten to not use Promises 🤔
Actually, it turns out the hang I was observing was not related to the way I was managing promises in my Cypress test code and it wound up resurfacing late last week.
In our case the problem seems to affect snapshots of a specific page template of which you can find a representative example here (note: this specific link may break if the MLS data changes, but you can find other examples on the /properties/ page). I'm having issues reproducing the hang locally on macOS with node 16 but I can consistently reproduce it in the GitHub Actions ubuntu-latest
environment. Here's a repository with a basic reproducible test case: https://github.com/bporcelli/percy-hang-error
And here's an example of an actions run where the process seemed to hang after the "Finalizing snapshot..." message was logged: https://github.com/bporcelli/percy-hang-error/runs/5366359202
You can see that the process just got stuck there until the configured job timeout of 15m was eventually reached.
@wwilsman Any ideas what may be happening here? We're really excited about integrating Percy into our Cypress test suites but this is holding us up. Thanks in advance for your help!
@wwilsman Just wanted to follow up and see if you or someone else on the Percy team has had time to look into this issue. My last comment includes a reproducible test case that may help with your investigation. If you need any other information please let me know.
This issue is stale because it has been open for more than 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This issue was closed because it has been stalled for 28 days with no activity.
This issue is stale because it has been open for more than 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This issue is stale because it has been open for more than 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This issue was closed because it has been stalled for 28 days with no activity.
@Robdel12 or @bporcelli Did you guys solve this?, I'm experiencing the exact same issue...
@sigginjals I eventually discovered that this is an issue with Cypress (https://github.com/cypress-io/cypress/issues/8206). Switching the test browser from Electron to Chrome resolved the issue for my team. Tests have been running without hangs now for a couple months.
The problem
Reposting from https://github.com/percy/cli/issues/735#issuecomment-1020399498:
Seems to be handing indefinitely after:
It looks like the problem might be related to the
execute.afterNavigation
taking a while to execute.This causes the issue:
whereas this seems fine (change the sleep time from 1000 to 500):
Environment
@percy/cli
version:v1.0.0-beta.74
Details
If necessary, describe the problem you have been experiencing in more detail.
Debug logs
Running with
--verbose
did not produce and more results.