[Bug 43082] New: Flaky action_logs.t object filter test due to default LIKE matching
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43082 Bug ID: 43082 Summary: Flaky action_logs.t object filter test due to default LIKE matching 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: --- This patch fixes an intermittent failure in t/db_dependent/api/v1/action_logs.t. The 'object filter returns rows for object 42' assertion queries the REST API with ?object=42. Koha's REST API defaults every typed query parameter, including integer columns, to _match=contains, which builds a LIKE '%42%' query (Koha/REST/Plugin/Query.pm). This means the filter also matches any object value that merely contains "42" as a substring, e.g. 420, 142, 1042. The test's own fixture data uses a dynamically assigned patron borrowernumber (auto_increment, never reset by transaction rollback) as the object value for other rows logged in the same subtest. When that value drifts into a range containing "42" as a substring during a full CI run, the assertion intermittently counts an extra row and fails, even though the test passes reliably in isolation. The fix adds _match=exact to the object filter request, matching the test's actual intent of an exact object id match. Test plan: 1. Run prove t/db_dependent/api/v1/action_logs.t - it passes. 2. To see the underlying bug, insert an action_log row with object 42 and another with object 420, then query GET /api/v1/action_logs?object=42 without _match=exact - both rows are incorrectly returned. 3. Apply the patch and repeat step 1 - only the exact-match row is expected and returned. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43082 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chris@bigballofwax.co.nz |martin.renvoize@openfifth.c | |o.uk Depends on| |29016 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 [Bug 29016] Improve performance of the Log viewer when working with a high volume of action logs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43082 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43082 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 201962 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201962&action=edit Bug 43082: Fix flaky object filter test in action_logs.t The default `_match=contains` matching builds a LIKE query even on integer columns, so a plain `?object=42` also matches object values like 420 or 142. The test's dynamically-assigned patron borrowernumber (auto_increment, never reset by transaction rollback) could drift into a value containing "42" as a substring, intermittently inflating the match count in CI. Add `_match=exact` since the test's intent is an exact object id match. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43082 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43082 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Severity|normal |trivial -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43082 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=43082 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #201962|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=43082 --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 201970 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201970&action=edit Bug 43082: Fix flaky object filter test in action_logs.t The default `_match=contains` matching builds a LIKE query even on integer columns, so a plain `?object=42` also matches object values like 420 or 142. The test's dynamically-assigned patron borrowernumber (auto_increment, never reset by transaction rollback) could drift into a value containing "42" as a substring, intermittently inflating the match count in CI. Add `_match=exact` since the test's intent is an exact object id match. 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=43082 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette@bywatersolutions.co | |m QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43082 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43082 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #201970|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=43082 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 202803 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202803&action=edit Bug 43082: Fix flaky object filter test in action_logs.t The default `_match=contains` matching builds a LIKE query even on integer columns, so a plain `?object=42` also matches object values like 420 or 142. The test's dynamically-assigned patron borrowernumber (auto_increment, never reset by transaction rollback) could drift into a value containing "42" as a substring, intermittently inflating the match count in CI. Add `_match=exact` since the test's intent is an exact object id match. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43082 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43082 --- Comment #4 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org