Bugzilla – Attachment 56171 Details for
Bug 17426
AutoCommit should not be set in tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17426: Do not set AutoCommit in tests
Bug-17426-Do-not-set-AutoCommit-in-tests.patch (text/plain), 2.60 KB, created by
Jonathan Druart
on 2016-10-11 12:16:53 UTC
(
hide
)
Description:
Bug 17426: Do not set AutoCommit in tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-10-11 12:16:53 UTC
Size:
2.60 KB
patch
obsolete
>From b91cdd257e6b2ba99a31ea38945bf984ac5a186b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 11 Oct 2016 13:15:27 +0100 >Subject: [PATCH] Bug 17426: Do not set AutoCommit in tests > > git grep AutoCommit t | grep 1 > >highlights that 1 test use AutoCommit set, it should not > >The other change removes the FIXME should has been fixed. > >Test plan: > prove t/db_dependent/BackgroundJob.t > t/db_dependent/Patron/Borrower_Discharge.t > >should still return green >--- > t/db_dependent/BackgroundJob.t | 2 +- > t/db_dependent/Patron/Borrower_Discharge.t | 13 +++---------- > 2 files changed, 4 insertions(+), 11 deletions(-) > >diff --git a/t/db_dependent/BackgroundJob.t b/t/db_dependent/BackgroundJob.t >index 3cc5348..7005594 100644 >--- a/t/db_dependent/BackgroundJob.t >+++ b/t/db_dependent/BackgroundJob.t >@@ -12,7 +12,7 @@ my $query = new CGI; > > # Generate a session id > my $dbh = C4::Context->dbh; >-$dbh->{AutoCommit} = 1; >+$dbh->{AutoCommit} = 0; > $dbh->{RaiseError} = 1; > > my $session = C4::Auth::get_session; >diff --git a/t/db_dependent/Patron/Borrower_Discharge.t b/t/db_dependent/Patron/Borrower_Discharge.t >index 9fde49c..d256f94 100644 >--- a/t/db_dependent/Patron/Borrower_Discharge.t >+++ b/t/db_dependent/Patron/Borrower_Discharge.t >@@ -15,7 +15,7 @@ > # with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 17; >+use Test::More tests => 18; > use Test::Warn; > use MARC::Record; > >@@ -118,15 +118,8 @@ else { > "Expected failure because of missing PDF::FromHTML."; > } > >-# FIXME >-# At this point, there is a problem with the AutoCommit off >-# The transaction is bloked into DBIx::Class::Storage::DBI::_dbh_execute >-# line my $rv = $sth->execute(); >-# We are using 2 connections and the one used by Koha::Schema has the AutoCommit set to 1 >-# Even if we switch off this flag, the connection will be blocked. >-# The error is: >-# DBIx::Class::ResultSet::create(): DBI Exception: DBD::mysql::st execute failed: Lock wait timeout exceeded; try restarting transaction [for Statement "INSERT INTO discharges ( borrower, needed, validated) VALUES ( ?, ?, ? )" with ParamValues: 0='121', 1='2014-01-08T16:38:29', 2=undef] at /home/koha/src/Koha/DataObject/Discharge.pm line 33 >-#is( Koha::Service::Borrower::Discharge::request({ borrowernumber => $patron->{borrowernumber} }), 1, 'Discharge request sent' ); >+# FIXME Should be a Koha::Object object >+is( ref(Koha::Patron::Discharge::request({ borrowernumber => $patron->{borrowernumber} })), 'Koha::Schema::Result::Discharge', 'Discharge request sent' ); > > $schema->storage->txn_rollback; > >-- >2.8.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17426
:
56171
|
56192
|
56692