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

            Bug ID: 43669
           Summary: Selenium tests can fail if server is still restarting
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Test Suite
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
  Target Milestone: ---

This patch adds a wait_for_server_ready check to t::lib::Selenium, so
Selenium-based tests poll the server until it responds successfully before
driving it, instead of assuming it is already up.

This guards against a race we saw on Jenkins CI:
t/db_dependent/selenium/00-onboarding.t and
t/db_dependent/selenium/01-installation.t both failed with 'no such element:
//div[@class="alert alert-success"]' right after the DB connection check step,
immediately after run_tests.pl's get_commands_to_reset_db() restarted
Apache/Plack. That helper restarts services and moves straight to running the
tests with no readiness wait, so the very first requests can hit workers that
are still warming up. The test then fails on a missing page element even though
there is no bug in the installer flow itself.

A companion issue has been filed against koha-misc4dev to add a readiness wait
to run_tests.pl itself:
https://gitlab.com/koha-community/koha-misc4dev/-/work_items/108

Test plan:
1. Apply the patch
2. Run t/db_dependent/selenium/01-installation.t (or 00-onboarding.t) against a
fresh empty database with KOHA_TESTING=1, as usual
3. Confirm it still passes normally
4. To exercise the new wait: drop/recreate the database, then run "sudo service
apache2 restart" and "sudo service koha-common restart", then immediately run
the selenium test with no delay. Confirm it either passes (server came up in
time) or fails fast with a clear "Cannot wait more for the server to be ready"
message rather than a confusing missing-element error deep in the install
wizard

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to