[Koha-bugs] [Bug 35506] selenium/regressions.t is failing randomly

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Jan 29 04:31:31 CET 2024


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35506

--- Comment #39 from Victor Grousset/tuxayo <victor at tuxayo.net> ---
note: I'm running on top of b54da05c73 and not main/master since the last big
push makes the alternate patch not apply.
If the alternate patch still is pursued, the refactor that moves the function
definitions would be easier to deal with in a separate commit to not miss other
changes in the diff.

----------------------------------------------------------------------------------------------

Unfortunately it failed. (23 runs)

        t/db_dependent/selenium/regressions.t:190 in
Selenium::Remote::Driver::find_element
...
#   Failed test 'No tests run for subtest "Display circulation table
correctly"'
...
Error while executing command: no such element: Unable to locate element:
//a[@id="issues-table-load-now-button"] at
/usr/share/perl5/Selenium/Remote/Driver.pm line 411.

Screenshot shows login screen without filled in credentials. I don't know what
is this failure case, my branch doesn't have anything that would have prevented
this. So, non conclusive.

----------------------------------------------------------------------------------------------

Another fail (760 runs)
        t/db_dependent/selenium/regressions.t:317 in
Selenium::Remote::Driver::find_element
...
#   Failed test 'Encoding in session variables'
....
Error while executing command: no such element: Unable to locate element:
//a[@id="issues-table-load-now-button"] at
/usr/share/perl5/Selenium/Remote/Driver.pm line 411.

This one might be caused by this weird bug (I'll confirm it if it happens
again):
https://gitlab.com/tuxayo/Koha/-/commit/759a8dffb7ecedb0feff8ffac81231d0016d8c0d#b635f6d9de31295e092d44725ae114697e8ff560_316_325
So it might not be a sign of the alternate patch failure.
760 runs I almost though the alternate patch was reliable but now I'm not sure,
continuing.

----------------------------------------------------------------------------------------------

Another fail (2 run) the variance is insane!
    #   Failed test 'Checkouts table must be correctly aligned'
    #   at t/db_dependent/selenium/regressions.t line 204.
    #          got: ''
    #     expected: '1'
    # thead: 16 ; tfoot: 16 ; tbody: 0
#   Failed test 'Display circulation table correctly'

That might be a need for wait_for_ajax, so I'm adding to be able to continue to
test.
That's what I have in my branch before the place it fails.
https://gitlab.com/tuxayo/Koha/-/commit/759a8dffb7ecedb0feff8ffac81231d0016d8c0d#b635f6d9de31295e092d44725ae114697e8ff560_192_198
If it was the previous wait_for_page_fully_ready that was needed, I think we
would not see the thead: 16 ; tfoot 16 but the body at 0 size. Likely it means
that the table is waiting to load.

----------------------------------------------------------------------------------------------

Another fail (8 runs)
#   Failed test 'Encoding in session variables'
#   at t/db_dependent/selenium/regressions.t line 342.
Can't call method "get_text" on an undefined value at
t/db_dependent/selenium/regressions.t line 327.

plack.log shows that /intranet/svc/checkouts?borrowernumber=71 was done. So
it's certain it's a need for wait_for_ajax

----------------------------------------------------------------------------------------------

Another fail (3 runs), the difference with the 760 runs is that now I'm using
the computer in parallel. Browsing, writing messages in chat mostly. Crazy how
that makes a difference.
        t/db_dependent/selenium/regressions.t:319 in
Selenium::Remote::Driver::find_element
...
#   Failed test 'Encoding in session variables'
...
Error while executing command: no such element: Unable to locate element:
//a[@id="issues-table-load-now-button"] at
/usr/share/perl5/Selenium/Remote/Driver.pm line 411.

Ok, I see the checkout is done (in earlier fail, I reset the DB before thinking
ok checking this), that confirms I'm hitting this issue.
https://gitlab.com/tuxayo/Koha/-/commit/759a8dffb7ecedb0feff8ffac81231d0016d8c0d#b635f6d9de31295e092d44725ae114697e8ff560_316_326

I'm basically redoing all the secondary fixes again >_<
I hope that will be as quick. The good thing is that it solidifies their
utility.

----------------------------------------------------------------------------------------------

after 65 runs
        t/db_dependent/selenium/regressions.t:308 in
Selenium::Remote::Driver::find_element
...
#   Failed test 'Encoding in session variables'
....
Error while executing command: no such element: Unable to locate element:
//span[@class="logged-in-branch-name"] at
/usr/share/perl5/Selenium/Remote/Driver.pm line 411.

Screenshot shows logged out screen. Issue is not something handled in my branch
(and I'm not sure I got it) so it's just one more random issue that doesn't
tell about the alternate patch.

----------------------------------------------------------------------------------------------

after 30 runs
        t/db_dependent/selenium/regressions.t:325 in
Selenium::Remote::Driver::find_element
...
#   Failed test 'Encoding in session variables'
...
Error while executing command: no such element: Unable to locate element:
//a[@id="issues-table-load-now-button"] at
/usr/share/perl5/Selenium/Remote/Driver.pm line 411.

And screenshot showing checkout page with 0 checkouts. It refreshed per the
previous hack introduced to fix another issue that happened twice in previous
failures. But why no checkout then? Looking at the logs. Just before the
refresh, I see
"GET errors/404.pl HTTP/1.1" 404 29830
"http://koha:8081/cgi-bin/koha/circ/circulation.pl" "Mozilla/5.0 (X11; Linux
x86_64; rv:92.0) Gecko/20100101 Firefox/92.0"

Why 404? No idea. No fix to add/attempt :(

----------------------------------------------------------------------------------------------

after 590 runs
        t/db_dependent/selenium/regressions.t:190 in
Selenium::Remote::Driver::find_element
...
#   Failed test 'No tests run for subtest "Display circulation table
correctly"'
...
Error while executing command: no such element: Unable to locate element:
//a[@id="issues-table-load-now-button"] at
/usr/share/perl5/Selenium/Remote/Driver.pm line 411.

Screenshot shows logged out screen, session timed out (I know the message isn't
always relevant). No idea why.

----------------------------------------------------------------------------------------------

after 6 runs (PC not even used. I though that was when I would almost never
fail. But then it fails quick, what is that terrible variance!)
        t/db_dependent/selenium/regressions.t:308 in
Selenium::Remote::Driver::find_element
...
#   Failed test 'Encoding in session variables'
...
Error while executing command: no such element: Unable to locate element:
//span[@class="logged-in-branch-name"] at
/usr/share/perl5/Selenium/Remote/Driver.pm line 411.

Screenshot shows logged out screen, session timed out. Again, no idea why.

----------------------------------------------------------------------------------------------

That's really tough to draw clear conclusions. At least it's certain the
alternate patch helps. My only idea to confirm it's as reliable as the 1st
proposal is to do to still more runs. Then rebase my branch on top of
b54da05c73 and do 1000 or 1500 runs and see if I have the same unexplained
fails. I think I had the logout thing only once back when I did the 1st fix
proposal.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list