From b824c29eef514ece7d3810162c2d58273bb0b4c5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 10 Sep 2024 10:40:20 +0200 Subject: [PATCH] Bug 37870: Run tests from ClassSources.t within transactions Signed-off-by: CJ Lynce Signed-off-by: Tomas Cohen Arazi Signed-off-by: Katrin Fischer --- t/db_dependent/ClassSources.t | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/t/db_dependent/ClassSources.t b/t/db_dependent/ClassSources.t index a58a25f507..98d8f2b988 100755 --- a/t/db_dependent/ClassSources.t +++ b/t/db_dependent/ClassSources.t @@ -36,6 +36,8 @@ subtest 'GetClassSources' => sub { plan tests => 5; + $schema->storage->txn_begin; + my $class_rule = $builder->build( { source => 'ClassSortRule', @@ -82,12 +84,17 @@ subtest 'GetClassSources' => sub { is( $class_sources_cached->{$source_code}, undef, "New value now present after cache cleared" ); $class_sources_cached = GetClassSources(); is_deeply( $class_sources, $class_sources_cached, "New cached version does match the updated fresh version" ); + + $schema->storage->txn_rollback; + }; subtest 'GetClassSource' => sub { plan tests => 4; + $schema->storage->txn_begin; + my $class_rule = $builder->build( { source => 'ClassSortRule', @@ -123,12 +130,16 @@ subtest 'GetClassSource' => sub { $class_source_cache = GetClassSource($source_code); is( $class_source_cache->{description}, $class_source_db->{description}, "Now both get the correct value" ); + $schema->storage->txn_rollback; + }; subtest 'GetClassSortRule' => sub { plan tests => 4; + $schema->storage->txn_begin; + my $class_rule_1 = $builder->build( { source => 'ClassSortRule', @@ -153,4 +164,6 @@ subtest 'GetClassSortRule' => sub { $class_sort_rule_cache = GetClassSortRule($sort_rule); is_deeply( $class_sort_rule_cache, $class_sort_rule_db, "Now both get the correct value" ); + $schema->storage->txn_rollback; + }; -- 2.39.5