@@ -, +, @@ # Failed test 'AddReturn must have debarred the patron' # at t/db_dependent/Circulation.t line 3112. # got: '' # expected: '1' # AddReturn returned message $VAR1 = { # 'WasReturned' => 1 # }; # Failed test 'Test at line 1918' # at t/db_dependent/Circulation.t line 3116. # got: '0' # expected: '1' # Failed test 'Test at line 1918' # at t/db_dependent/Circulation.t line 3119. # got: undef # expected: '2019-05-30' # Looks like you failed 3 tests of 21. --- t/db_dependent/Circulation.t | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/t/db_dependent/Circulation.t +++ a/t/db_dependent/Circulation.t @@ -53,6 +53,11 @@ $schema->storage->txn_begin; my $builder = t::lib::TestBuilder->new; my $dbh = C4::Context->dbh; +# Prevent random failures by mocking ->now +my $now_value = DateTime->now(); +my $mocked_datetime = Test::MockModule->new('DateTime'); +$mocked_datetime->mock( 'now', sub { return $now_value->clone; } ); + # Start transaction $dbh->{RaiseError} = 1; @@ -1915,7 +1920,6 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { item => $item_1, library => $library, patron => $patron, - due_date => dt_from_string->add(minutes=> 1), return_date => dt_from_string->add(days => 5), expiration_date => dt_from_string->add(days => 5 + (5 * 2 - 1) ), } --