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

unskip test_admin_edits_hotp_secret and test_admin_edits_totp_secret #4977

Closed
redshiftzero opened this issue Nov 8, 2019 · 5 comments · Fixed by #4995
Closed

unskip test_admin_edits_hotp_secret and test_admin_edits_totp_secret #4977

redshiftzero opened this issue Nov 8, 2019 · 5 comments · Fixed by #4995
Assignees
Labels
help wanted Issues we would definitely appreciate volunteer help with priority/high
Milestone

Comments

@redshiftzero
Copy link
Contributor

Description

As part of #4974 we had to temporarily skip two tests (test_admin_edits_hotp_secret and test_admin_edits_totp_secret) that failed CI when we ran using the latest version of Tor Browser which were hanging CI indefinitely. We should investigate why these tests are hanging and resolve. See also #4691 where similar but intermittent behavior was also reported.

@redshiftzero redshiftzero added priority/high help wanted Issues we would definitely appreciate volunteer help with labels Nov 8, 2019
@redshiftzero redshiftzero added this to the 1.2.0 milestone Nov 8, 2019
@garrettr
Copy link
Contributor

I'm stepping through test_admin_edits_totp_secret in pdb and it's hanging in _admin_visits_reset_2fa_totp on self.retry_2fa_pop_ups(_admin_visits_reset_2fa_totp_step, "reset-two-factor-totp").

@garrettr
Copy link
Contributor

Just logging some progress here in case someone else wants to pick up where I've left off.

In _admin_visits_reset_2fa_totp, clicking the "reset 2fa" button via self.safe_click_by_id("button-reset-two-factor-totp") is expected to trigger the JS confirmation dialog registered in journalist.js.

I walked through test_admin_edits_totp_secret in pdb and found that clicking button-reset-two-factor-totp takes ~1-2 seconds to return. Once the pdb prompt returns, p self.driver.page_source shows that the form was submitted and the next view, admin.new_user_two_factor, was rendered. It seems the expected confirmation dialog was not shown, so the test gets stuck in retry_2fa_pop_ups.

Next, I watched the test over VNC. I didn't see the confirmation dialog there either, although VNC was a little slow/glitchy, so it's possible I missed it.

This behavior suggests a possible cause: if journalist.js is not loading or executing in the test Tor Browser, then what I saw is what you would expect: clicking the form submit button would go directly to the next page in the 2fa reset flow, without being held up by a confirmation dialog that requires JS to exist.

I tried repeating the steps of the test by running make dev and using Tor Browser 9 on my Mac to walk through a 2fa reset flow, and got the expected JS confirmation dialog, so I think this issue is unique to the functional test environment (or possibly Linux?).

Somewhat desperately, I tried updating to the latest geckodriver (v0.26.0), but that didn't resolve the issue.

I think the next best thing would be to get some more useful logs (e.g. web console, network) out of the browser and Selenium webdriver. Does anybody know how to do that?

@garrettr
Copy link
Contributor

The skipped tests pass if I switch the default driver for the functional tests from Tor Browser to Firefox ESR, which suggests this issue is specific to Tor Browser or tbselenium.

@zenmonkeykstop
Copy link
Contributor

This makes sense, there was another test that was failing (rather than hanging) because Javascript was being disabled in TBB. PR #4987 will fix that one, and if it passes muster the same fix will work here.

@zenmonkeykstop zenmonkeykstop self-assigned this Nov 14, 2019
@zenmonkeykstop
Copy link
Contributor

Grabbing now that #4987 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues we would definitely appreciate volunteer help with priority/high
Projects
None yet
3 participants