Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Test hangs for additional ~4s if assertion fails #38

Closed
skyiea opened this issue Dec 31, 2017 · 7 comments
Closed

[Bug] Test hangs for additional ~4s if assertion fails #38

skyiea opened this issue Dec 31, 2017 · 7 comments

Comments

@skyiea
Copy link

skyiea commented Dec 31, 2017

In case if screenshots match my test ends in 3s.
If they don't match - in 7s.

For some reason test hangs for additional 4 seconds, even though the actual assertion failure occurs earlier.

@anescobar1991
Copy link
Member

anescobar1991 commented Dec 31, 2017

That is happening because the diff image creation is very slow within the Jest environment. The diff image is only created for failing tests and said creation is slow because calls to ‘Math’ are orders of magnitude slower in Jest environment than outside of it in node.

Original issue in Jest tracking it is jestjs/jest#4972

I apologize I’ve been unable to do any work outside of responding to issues in last few weeks but I have not had access to a computer for more than an hour a day. I will definitely look into this (and some of the other issues you have brought up) when I get back into the office late next week.

@chrbala
Copy link
Contributor

chrbala commented Jan 2, 2018

Would it be possible to do a side-by-side diff instead? The old image diff generator was much faster iirc, because it didn't generate as substantial of a diff.

It would be nice to be able to disable the complete diff - most of the time I don't need to see an overlay diff.

@skyiea
Copy link
Author

skyiea commented Jan 3, 2018

@chrbala Here is the issue to track: #37
+1 for the idea to optionally disable diff generation in favor of before-and-after image

@skyiea skyiea closed this as completed Jan 3, 2018
@anescobar1991
Copy link
Member

@chrbala can you open separate issue for the side to side comparison only mode? Then I will discuss with my team tomorrow.

@anescobar1991
Copy link
Member

I am working on the PR that should take care of these perf issues. Should be opening it in next few days.

@skyiea skyiea reopened this Jan 15, 2018
@skyiea
Copy link
Author

skyiea commented Jan 15, 2018

Just now noticed that I accidentally closed it. Reopened.

@anescobar1991
Copy link
Member

anescobar1991 commented Jan 15, 2018

This should be solved in 2.3.0 with #40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants