Tests: Password reset tests sometimes ask for sign-in #2483
Comments
|
I updated the vnc driver, firefox and rebooted the test machine and this issue went away |
|
Which causes this failure: |
|
@shane-tomlinson , I need help tracking this down |
|
Let's put this on the priority queue to set aside time, I think this could On Thu, Jul 23, 2015 at 4:14 PM, Vlad Filippov notifications@github.com
|
|
fixed via #2895 |
|
This still happens :( |
|
If we cannot find a fix we should modify tests to expect both a "sign in" and "settings views instead of settings |
|
@shane-tomlinson seems like 10 seconds is not enough of a timeout for functional tests running against a remote browser: https://github.com/mozilla/fxa-content-server/blob/master/app/scripts/views/confirm_reset_password.js#L24 What should we do? |
…sts. There were several problems: 1. Because promises are async, setTimeout could be called after the module was torn down, which caused completion logic to be run after it was expected. 1. The timer-mixin called clearAllTimeouts without a context when used as a `destroy` handler, which meant outstanding timeouts were not cleared on view destroy. 1. The unit tests had a lot of cross test pollution. New dependencies are set up for each test now. 1. The logic did not take into account that the `login` message could arrive from the other tab before, during, or after the XHR request that checks whether the user has verified. There were no tests for all of these cases either. This fix takes a new approach to polling: When the user attempts a password reset, we have no idea whether the user is going to verify in the same browser. The only way we know if the user verified in this browser is if a `login` message is received from the inter-tab channel. Because we have no idea if the user will verify in this browser, assume they will not. Start polling the server to see if the user has verified. If the server eventually reports the user has successfully reset their password, assume the user has completed in a different browser. In this case the best we can do is ask the user to sign in again. Once the user has entered their updated creds, we can then notify the browser. If a `complete_reset_password_tab_open` message is received, hooray, the user has opened the password reset link in this browser. At this point we can assume the user will complete verification in this browser. It's not 100% certain the user will complete, but most likely. Stop polling the server. The server poll is no longer needed, and in fact makes things more complex. Instead, wait for the `login` message that will arrive once the user finishes the password reset. Once the `login` message has arrived, notify the browser. BOOM. fixes #2483
…sts. There were several problems: 1. Because promises are async, setTimeout could be called after the module was torn down, which caused completion logic to be run after it was expected. 1. The timer-mixin called clearAllTimeouts without a context when used as a `destroy` handler, which meant outstanding timeouts were not cleared on view destroy. 1. The unit tests had a lot of cross test pollution. New dependencies are set up for each test now. 1. The logic did not take into account that the `login` message could arrive from the other tab before, during, or after the XHR request that checks whether the user has verified. There were no tests for all of these cases either. This fix takes a new approach to polling: When the user attempts a password reset, we have no idea whether the user is going to verify in the same browser. The only way we know if the user verified in this browser is if a `login` message is received from the inter-tab channel. Because we have no idea if the user will verify in this browser, assume they will not. Start polling the server to see if the user has verified. If the server eventually reports the user has successfully reset their password, assume the user has completed in a different browser. In this case the best we can do is ask the user to sign in again. Once the user has entered their updated creds, we can then notify the browser. If a `complete_reset_password_tab_open` message is received, hooray, the user has opened the password reset link in this browser. At this point we can assume the user will complete verification in this browser. It's not 100% certain the user will complete, but most likely. Stop polling the server. The server poll is no longer needed, and in fact makes things more complex. Instead, wait for the `login` message that will arrive once the user finishes the password reset. Once the `login` message has arrived, notify the browser. BOOM. fixes #2483
…sts. There were several problems: 1. Because promises are async, setTimeout could be called after the module was torn down, which caused completion logic to be run after it was expected. 1. The timer-mixin called clearAllTimeouts without a context when used as a `destroy` handler, which meant outstanding timeouts were not cleared on view destroy. 1. The unit tests had a lot of cross test pollution. New dependencies are set up for each test now. 1. The logic did not take into account that the `login` message could arrive from the other tab before, during, or after the XHR request that checks whether the user has verified. There were no tests for all of these cases either. This fix takes a new approach to polling: When the user attempts a password reset, we have no idea whether the user is going to verify in the same browser. The only way we know if the user verified in this browser is if a `login` message is received from the inter-tab channel. Because we have no idea if the user will verify in this browser, assume they will not. Start polling the server to see if the user has verified. If the server eventually reports the user has successfully reset their password, assume the user has completed in a different browser. In this case the best we can do is ask the user to sign in again. Once the user has entered their updated creds, we can then notify the browser. If a `complete_reset_password_tab_open` message is received, hooray, the user has opened the password reset link in this browser. At this point we can assume the user will complete verification in this browser. It's not 100% certain the user will complete, but most likely. Stop polling the server. The server poll is no longer needed, and in fact makes things more complex. Instead, wait for the `login` message that will arrive once the user finishes the password reset. Once the `login` message has arrived, notify the browser. BOOM. fixes #2483
|
Seems like #3083 fix was not enough Running more tests... |
|
Still happens both on Teamcity 8111 and Travis :( |
|
Huh, and I just spent the day thinking "Seems like travis is mostly fixed." What a PITA. |
|
This was fixed by Shane! @shane-tomlinson woo hoo |
|
FIXEEEDDDD!!!! |





Shane linked the following code that we may investigate:
Refs: https://github.com/mozilla/fxa-content-server/blob/master/app/scripts/views/confirm_reset_password.js#L76
Refs: https://github.com/mozilla/fxa-content-server/blob/master/app/scripts/views/confirm_reset_password.js#L227
Happens only on TeamCity. Regular password reset and webchannel password reset tests are affected.
No clear to reproduce this yet. This error happens more when running a lot of tests (i.e using more memory). Slowing down the network does not help. Running this test on its own threw an error once out of ~12 times tried.
The text was updated successfully, but these errors were encountered: