[Bug 18289] New: Fix t/Prices.t having a Test::DBIx::Class cache issue
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18289 Bug ID: 18289 Summary: Fix t/Prices.t having a Test::DBIx::Class cache issue Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: olli-antti.kivilahti@jns.fi QA Contact: gmcharlt@gmail.com REPLICATE ISSUE: perl t/Prices.t -> fails AFTER THIS PATCH AND DEPENDENCIES: perl t/Prices.t -> OK -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18289 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18288, | |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18287 Status|NEW |Needs Signoff Depends on| |18266 Assignee|chris@bigballofwax.co.nz |olli-antti.kivilahti@jns.fi Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18266 [Bug 18266] Internal Server Error when paying fine for lost item -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18289 --- Comment #1 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 61190 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61190&action=edit Bug 18289 - Fix t/Prices.t having a Test::DBIx::Class cache issue REPLICATE ISSUE: perl t/Prices.t -> fails AFTER THIS PATCH AND DEPENDENCIES: perl t/Prices.t -> OK -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18289 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch Depends on|18266 |18226 --- Comment #2 from Marc Véron <veron@veron.ch> --- It seems that it depends on 18226, not 18266. (like dependencies of 18282 and 18288) Changed dependency as appropriate. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18226 [Bug 18226] Remove "use Test::DBIx::Class" instantiations' dangerous code duplication https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18266 [Bug 18266] Internal Server Error when paying fine for lost item -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18289 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I confirm that this fixes the tests on jenkins. diff --git a/Koha/Database.pm b/Koha/Database.pm index df259c5..f8a2fba 100644 --- a/Koha/Database.pm +++ b/Koha/Database.pm @@ -215,6 +215,11 @@ sub restore_schema { # return something, then this function should, too. } +sub flush_schema_cache { + delete $database->{schema}; + return 1; +} + =head2 EXPORT None by default. diff --git a/t/Prices.t b/t/Prices.t index f89c7f6..68dc788 100644 --- a/t/Prices.t +++ b/t/Prices.t @@ -29,6 +29,7 @@ use Test::DBIx::Class { my $db = Test::MockModule->new('Koha::Database'); $db->mock( _new_schema => sub { return Schema(); } ); +Koha::Database::flush_schema_cache(); fixtures_ok [ Currency => [ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18289 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #3)
I confirm that this fixes the tests on jenkins.
The way to reproduce this in kohadevbox (or the like) is to stop memcached before running the tests. And this patchset clearly fixes it! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18289 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18289 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=18289 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #61190|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 64002 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64002&action=edit Bug 18289 - Fix t/Prices.t having a Test::DBIx::Class cache issue REPLICATE ISSUE: perl t/Prices.t -> fails AFTER THIS PATCH AND DEPENDENCIES: perl t/Prices.t -> OK Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18289 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|--- |Trivial patch --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Trivial, skipping QA. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18289 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 17.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18289 Bug 18289 depends on bug 18226, which changed state. Bug 18226 Summary: Remove "use Test::DBIx::Class" instantiations' dangerous code duplication https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18226 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18289 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Resolution|--- |FIXED Status|Pushed to Master |RESOLVED --- Comment #8 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Enhancement not pushed to 17.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org