Bug 36010 - Items/AutomaticItemModificationByAge.t is failing
Summary: Items/AutomaticItemModificationByAge.t is failing
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on: 32029
Blocks:
  Show dependency treegraph
 
Reported: 2024-02-07 07:25 UTC by Jonathan Druart
Modified: 2024-03-19 19:51 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.04,23.05.10


Attachments
Bug 36010: Fix Items/AutomaticItemModificationByAge.t failing since Bug 32029 (1.73 KB, patch)
2024-02-08 11:25 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 36010: Fix Items/AutomaticItemModificationByAge.t failing since Bug 32029 (1.80 KB, patch)
2024-02-09 08:29 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 36010: Fix Items/AutomaticItemModificationByAge.t failing since Bug 32029 (1.85 KB, patch)
2024-02-29 13:05 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2024-02-07 07:25:58 UTC
koha_1       | #   Failed test 'ToggleNewStatus: conditions on biblio'
koha_1       | #   at t/db_dependent/Items/AutomaticItemModificationByAge.t line 356.
koha_1       | #          got: 'agefield_new_value'
koha_1       | #     expected: 'new_updated_value_biblio'
koha_1       | # Looks like you failed 1 test of 20.

Koha_Master_My8/1279

First failure from this one that has been pushed recently. I don't recreate locally (even using MySQL8).

Maybe something to do with the age comparison if the node is slow?
Comment 2 Martin Renvoize 2024-02-08 10:19:25 UTC
Hmm, I couldn't get this to fail locally.. strange.
Comment 3 Fridolin Somers 2024-02-08 10:51:19 UTC
I'll try to fix ASAP
Comment 4 Fridolin Somers 2024-02-08 11:16:42 UTC
(In reply to Martin Renvoize from comment #2)
> Hmm, I couldn't get this to fail locally.. strange.

Same.

Is it possible the koha to marc mapping on 245$h does not exists ?
Since biblio.medium is a recent column.
Comment 5 Fridolin Somers 2024-02-08 11:25:58 UTC
Created attachment 161889 [details] [review]
Bug 36010: Fix Items/AutomaticItemModificationByAge.t failing since Bug 32029

UT is failing in jenkins.
Change to use biblio.copyrightdate instead of bilio.medium

Run prove t/db_dependent/Items/AutomaticItemModificationByAge.t
Comment 6 Fridolin Somers 2024-02-08 11:28:39 UTC
biblio.copyrightdate is a more ancient column.
I hope it fixes.
Comment 7 Jonathan Druart 2024-02-08 11:32:33 UTC
It's failing on MySQL8 only.
Comment 8 Jonathan Druart 2024-02-08 11:37:07 UTC
(In reply to Jonathan Druart from comment #7)
> It's failing on MySQL8 only.

Forget that, I don't recreate locally either!
Comment 9 Martin Renvoize 2024-02-08 18:34:51 UTC
Given we're all failing to get this one to fail locally, I'm tempted to say we push it and see what Jenkins does.  It's really odd
Comment 10 Jonathan Druart 2024-02-09 08:25:04 UTC
I don't really understand how you are trying to fix the problem. Why would it come from this specific field?
Comment 11 Jonathan Druart 2024-02-09 08:26:32 UTC
Well, recreating what Jenkins does is always a good thing.

So, it's failing:

  koha-mysql kohadev -e "DROP DATABASE koha_kohadev" || true
  mysql -h db -u koha_kohadev -ppassword -e"CREATE DATABASE koha_kohadev"
  flush_memcached
  sudo service apache2 restart
  sudo service koha-common restart
  koha-mysql kohadev < /kohadevbox/misc4dev/data/sql/marc21/dump_kohadev_v19.11.00.sql
  sudo koha-shell kohadev -p -c 'perl /kohadevbox/koha/installer/data/mysql/updatedatabase.pl'
  koha-mysql kohadev -e 'UPDATE systempreferences SET value="21.1100000" WHERE variable="version"'
  sudo koha-shell kohadev -p -c 'perl /kohadevbox/koha/installer/data/mysql/updatedatabase.pl'


Then:
prove t/db_dependent/Items/AutomaticItemModificationByAge.tt/db_dependent/Items/AutomaticItemModificationByAge.t .. 18/20 #   Failed test 'ToggleNewStatus: conditions on biblio'#   at t/db_dependent/Items/AutomaticItemModificationByAge.t line 356.#          got: 'agefield_new_value'#     expected: 'new_updated_value_biblio'# Looks like you failed 1 test of 20.
t/db_dependent/Items/AutomaticItemModificationByAge.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/20 subtests 

Test Summary Report
-------------------
t/db_dependent/Items/AutomaticItemModificationByAge.t (Wstat: 256 Tests: 20 Failed: 1)
  Failed test:  19
  Non-zero exit status: 1
Files=1, Tests=20,  3 wallclock secs ( 0.02 usr  0.01 sys +  1.84 cusr  0.26 csys =  2.13 CPU)
Result: FAIL
Comment 12 Jonathan Druart 2024-02-09 08:29:25 UTC
Applying the patch and it's passing...?

Signing off
Comment 13 Jonathan Druart 2024-02-09 08:29:43 UTC
Created attachment 161959 [details] [review]
Bug 36010: Fix Items/AutomaticItemModificationByAge.t failing since Bug 32029

UT is failing in jenkins.
Change to use biblio.copyrightdate instead of bilio.medium

Run prove t/db_dependent/Items/AutomaticItemModificationByAge.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 14 Victor Grousset/tuxayo 2024-02-29 13:05:13 UTC
Created attachment 162597 [details] [review]
Bug 36010: Fix Items/AutomaticItemModificationByAge.t failing since Bug 32029

UT is failing in jenkins.
Change to use biblio.copyrightdate instead of bilio.medium

Run prove t/db_dependent/Items/AutomaticItemModificationByAge.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 15 Victor Grousset/tuxayo 2024-02-29 13:09:04 UTC
Well done Jonathan for finding a way to reproduce :D . It can be reproduced even with MariaDB (11.3) in my case.

(In reply to Jonathan Druart from comment #10)
> I don't really understand how you are trying to fix the problem. Why would
> it come from this specific field?

Me neither ^^"

Thanks Fridolin for good intuition that allows to dodge the bug.

There is likely a real bug underneath. But since it's not obvious and until it's seen in real usage, there no need to bother more that fixing the test here.

Works, QA script happy, code looks good, passing QA :)
Comment 16 Katrin Fischer 2024-03-07 15:37:59 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 17 Fridolin Somers 2024-03-11 10:17:33 UTC
Pushed to 23.11.x for 23.11.04
Comment 18 Lucas Gass 2024-03-19 19:51:35 UTC
Backported to 23.05.x for upcoming 23.05.10