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

fix: optimize QR code decode method in flaky 2FA test #20033

Merged
merged 3 commits into from
Feb 26, 2025

Conversation

netroms
Copy link
Contributor

@netroms netroms commented Feb 21, 2025

Issue:

Flaky 2FA test TwoFactorControllerTest.testEnrollTOTP2FA , gives no stacktrace when it fails.
This is the only output we get when it fails:

Error:  org.hisp.dhis.webapi.controller.TwoFactorControllerTest.testEnrollTOTP2FA -- Time elapsed: 0.163 s <<< ERROR!
com.google.zxing.NotFoundException

And com.google.zxing.ChecksumException

Cause:

Seems to be the QR decode method can fail sometimes, due to lack of precision in the decoder.
There is a choice between performance/speed and accuracy in the decoder, and the default settings prefer speed.

Fix:

Tell the decoder to prefer accuracy.

@netroms netroms changed the title chore: add asserts to flaky 2FA test fix: optimize QR code decode method in flaky 2FA test Feb 26, 2025
@netroms netroms merged commit 48a1168 into master Feb 26, 2025
17 checks passed
@netroms netroms deleted the chore_assert_flaky_2FA_test branch February 26, 2025 12:16
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

Successfully merging this pull request may close these issues.

4 participants