[Bug 44337] New: Holdings table spec fails intermittently waiting for a searchItems request after Show filters
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44337 Bug ID: 44337 Summary: Holdings table spec fails intermittently waiting for a searchItems request after Show filters Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org Target Milestone: --- t/cypress/integration/KohaTable/Holdings_spec.ts fails intermittently, for example "Filters by code and description" on Koha_Main_D13 #2419 and Koha_Main_D12 #4085: CypressError: Timed out retrying after 10000ms: cy.wait() timed out waiting 10000ms for the 12th request to the route: searchItems. No request ever occurred. On a CI-like instance (Debian 13, MariaDB 11.8, Elasticsearch 8) it fails in most runs, in two places: the 12th wait of "Filters by code and description", and the 2nd wait of "Filters by code and description - BEA/Bearville vs BCH/Beachville". Both waits come straight after clicking "Show filters". The spec counts cy.wait("@searchItems") calls and assumes clicking "Show filters" always causes a new items request. It does not always: when it fails, the page state shows the click did run (Hide filters visible, filters row present, table showing 20 rows) but the browser made no further XHR (its own resource timeline lists the same 11 requests Cypress saw). So the number of requests is not a reliable signal. The spec should wait for what it actually needs: the filters row to be shown and populated, and then for the request caused by the filter it selects or types, rather than counting requests. Not yet explained: why rebuilding the table (build_items_table with destroy in catalogue_detail.inc) sometimes does not fetch again. Visually the table is correct. Test plan: 1. Start KTD (Elasticsearch, any search engine is fine). 2. Run several times: yarn cypress run --spec t/cypress/integration/KohaTable/Holdings_spec.ts 3. Before the patch it fails intermittently with the error above; after the patch it passes every time. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44337 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 212800 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212800&action=edit Bug 44337: Fix intermittent failures of the Holdings table Cypress spec "Filters by code and description" and "Filters by code and description - BEA/Bearville vs BCH/Beachville" fail intermittently with cy.wait() timed out waiting 10000ms for the Nth request to the route: searchItems. No request ever occurred. The filters of the table are (re)built by _dt_add_filters, which replaces the filter row's <select> elements, once after the table is created and again each time a draw shows or hides columns (column-visibility.dt, e.g. columns with no data). cy.wait("@searchItems") resolves when the response has been received, which can be before the browser has drawn the result and rebuilt the filters. A select made in between acts on an element that is about to be replaced, nothing is filtered, and the request the spec then waits for never happens. Also stop clicking "Show filters" in these two tests. It destroys and rebuilds the table, which is what the "Show filters" test is for, and the spec assumed it always caused a new request, which it does not. - Show the filters from the start with AlwaysShowHoldingsTableFilters (restored in afterEach) - Wait for the table to be idle (not drawing, request complete) before using a filter Test plan: 1. Start KTD, e.g. ktd --search-engine es8 --selenium up -d 2. Run several times: yarn cypress run --spec t/cypress/integration/KohaTable/Holdings_spec.ts 3. Before the patch it fails in most runs on a CI-like instance (Debian 13, MariaDB 11.8): "12th request" or "2nd request" never occurred 4. After the patch all 6 tests pass every time Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44337 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44337 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44337 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #212800|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44337 --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 212806 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212806&action=edit Bug 44337: Fix intermittent failures of the Holdings table Cypress spec "Filters by code and description" and "Filters by code and description - BEA/Bearville vs BCH/Beachville" fail intermittently with cy.wait() timed out waiting 10000ms for the Nth request to the route: searchItems. No request ever occurred. The filters of the table are (re)built by _dt_add_filters, which replaces the filter row's <select> elements, once after the table is created and again each time a draw shows or hides columns (column-visibility.dt, e.g. columns with no data). cy.wait("@searchItems") resolves when the response has been received, which can be before the browser has drawn the result and rebuilt the filters. A select made in between acts on an element that is about to be replaced, nothing is filtered, and the request the spec then waits for never happens. Also stop clicking "Show filters" in these two tests. It destroys and rebuilds the table, which is what the "Show filters" test is for, and the spec assumed it always caused a new request, which it does not. - Show the filters from the start with AlwaysShowHoldingsTableFilters (restored in afterEach) - Wait for the table to be idle (not drawing, request complete) before using a filter Test plan: 1. Start KTD, e.g. ktd --search-engine es8 --selenium up -d 2. Run several times: yarn cypress run --spec t/cypress/integration/KohaTable/Holdings_spec.ts 3. Before the patch it fails in most runs on a CI-like instance (Debian 13, MariaDB 11.8): "12th request" or "2nd request" never occurred 4. After the patch all 6 tests pass every time Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44337 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #3 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. Ran multiple times with: for i in {1..10}; do yarn cypress run --spec t/cypress/integration/KohaTable/Holdings_spec.ts; done 2. Failed once before the patch and no times after the patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44337 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chris@bigballofwax.co.nz |martin.renvoize@openfifth.c | |o.uk --- Comment #4 from David Nind <david@davidnind.com> --- Changed assignee 8-). -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org