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

Codeception acceptance tests fail randomly #526

Closed
JDGrimes opened this issue Sep 29, 2016 · 6 comments
Closed

Codeception acceptance tests fail randomly #526

JDGrimes opened this issue Sep 29, 2016 · 6 comments
Labels
Milestone

Comments

@JDGrimes
Copy link
Member

While doing local testing, I've found that the tests will fail randomly. This will often occur the first 1-2 times that a test is run, then after that it will work correctly. After a few minutes the whole thing often ensues all over again. The failures always happen at the step after the login step, and it turns out that it is the login step itself that is failing.

login screen saying "invalid username", and "lost password?"

I haven't yet tried to debug why this is happening, and perhaps it is related to my local set-up and isn't a global issue (I can't remember for sure whether I've observed failures matching this pattern on Travis CI or not).

One really strange aspect of it is that when a failure like this occurs, the failing test usually takes 2-3 times as long to complete as when it would succeed/fail for another reason. It makes me wonder if we have a race condition, and it only manifests itself when the underlying site is loading too slowly, or something.

@JDGrimes JDGrimes added the bug label Sep 29, 2016
@JDGrimes JDGrimes added this to the 2.2.0 milestone Sep 29, 2016
@JDGrimes
Copy link
Member Author

JDGrimes commented Oct 1, 2016

Yep, this is happening on Travis.

@JDGrimes
Copy link
Member Author

This does still happen, and happens on Travis sometimes still as well. However, it currently isn't egregious enough that I'm going to tackle it before this release. We'll get to it eventually though.

@JDGrimes JDGrimes removed this from the 2.2.0 milestone Nov 18, 2016
@JDGrimes
Copy link
Member Author

lucatume/wp-browser#65 might be a fix for this issue. It hasn't been causing us much headache on Travis recently though.

@JDGrimes
Copy link
Member Author

JDGrimes commented Jun 8, 2017

I just enabled an xDebug breakpoint on this error to see what is causing it, and the username submitted was shown to be dmin rather than admin. So apparently the issue is that the form fields are being filled out before they are actually ready. That ticket upstream might indeed fix the issue in that case.

@JDGrimes
Copy link
Member Author

JDGrimes commented Jun 8, 2017

Applying a fix similar to in that issue did not seem to help. I tried filling the field twice instead, and that seems to have worked; so far I haven't experienced these random failures anymore.

JDGrimes added a commit to WordPoints/dev-lib that referenced this issue Jun 8, 2017
The first time it is filled, it sometimes isn't ready to receive the
keystrokes yet, and may end up as `dmin` instead of `admin`. Filling it
twice seems to avoid this, and prevent random test failures.

See WordPoints/wordpoints#526
@JDGrimes JDGrimes added this to the 2.4.0 milestone Jun 9, 2017
@JDGrimes
Copy link
Member Author

Calling this fixed, if we continue to see issues we can reopen.

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

1 participant