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

cypress slows dramatically then crashes during text input, especially with clear #579

Closed
lukemadera opened this issue Jul 28, 2017 · 2 comments
Labels

Comments

@lukemadera
Copy link

lukemadera commented Jul 28, 2017

  • Operating System: Mac OS
  • Cypress Version: 0.19.4
  • Browser Version: Chrome 56

Happens both with the GUI and on the command line.

Is this a Feature or Bug?

Bug

Current behavior:

About 9 times out of 10, the test slows down dramatically then hangs when trying to fill in a text input. Using el.clear seems to increase the issue but it may just be any input being typed in. Other tests work fine, but 2 consistently fail. They are on pages with more DOM elements so it may be a memory issue. The 1 time out of 10 it passes, everything is fast and works fine, so the test does pass and there does not seem to be a problem with the test itself; it appears to be flake, related to CPU or memory overuse (my computer will start to hum loudly due to the fan working hard).

Note this same type of things happens on a 2nd test, also for a number input, that one with a clear. I've attached information, screenshots, and a video for the 1st case; happy to add the 2nd example if that helps.
In both cases, the entry point url for the test is the same - perhaps something on that initial page is causing cypress to crash / memory leak?

Desired behavior:

The tests pass consistently all the time and are fast.

How to reproduce:

I have only been able to reproduce with these 2 tests, but I can reproduce each time. I've attached a video recording and screenshots. When they hang, they hang indefinitely. Our Continuous Integration waits about 50 minutes until the 1 hour max then fails.

Test code:

The actual lines where it hangs is one of these 3 (not always the same line).

plInputText.setValue(`${selector} .x-qa-metric-short-description`, metricShortDescription, { skipClear: true });
    plInputTextArea.setValue(`${selector} .x-qa-metric-long-description`, 'METRIC LONG DESCRIPTION',
     { skipClear: true });
    plInputText.setValue(`${selector} .x-qa-metric-goal`, 10, { skipClear: true });

These use the following helper functions / files:

plInputText.clear = (el) => {
    return el.type('{ctrl}a{backspace}');
    // 2017.07.14 - backspace was hanging; back to clear.
    // return el.clear();
};

plInputText.setValue = (selector, value, options = { skipClear: false }) => {
    const el = cy.get(`${selector} ${inputSelector}`);
    let elCleared;
    if (options.skipClear) {
        elCleared = el;
    } else {
        elCleared = plInputText.clear(el);
    }
    if(typeof(value) !== 'string' || value.length) {
	    if (options.blurAfter) {
	        elCleared.type(value).blur();
	    } else {
	        elCleared.type(value);
	    }
    } else {
	    if (options.blurAfter) {
	        elCleared.blur();
	    }
    }
};

plInputTextArea.setValue = (selector, value, options = { skipClear: false }) => {
    const el = cy.get(`${selector} ${inputSelector}`);
    let elCleared;
    if (options.skipClear) {
        elCleared = el;
    } else {
        elCleared = plInputText.clear(el);
    }
    elCleared.type(value);
    if (options.blurAfter) {
        elCleared.blur();
    }
};

Additional Info (images, stack traces, etc)

Video of failure in the GUI:
http://recordit.co/jHejsA0MG3

CI fail, on Cypress Dashboard:
screen shot 2017-07-28 at 9 03 01 am

The actual CI output for the same fail - the test starts around 9 minutes into the build, nothing happens for 51 minutes, then the build is canceled at 60 minutes.

Edited: Removed image w/ key

@kuceb
Copy link
Contributor

kuceb commented Jul 17, 2018

Hi, @lukemadera I'm going to close this issue since I think it was fixed by spec Isolation in #681 , feel free to update this issue if you're still having problems

@kuceb kuceb closed this as completed Jul 17, 2018
@lukemadera
Copy link
Author

Ok, thanks for letting me know. I commented out this code due to the issue and haven't tried it since.

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

No branches or pull requests

3 participants