File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ public function testDuplicateKeyUpgrade() {
142142
143143 try {
144144 $ migrator ->migrate ($ endSchema );
145- } catch (Exception \UniqueConstraintViolationException $ e ) {
145+ } catch (Exception \UniqueConstraintViolationException $ e ) {
146146 $ this ->connection ->rollBack ();
147147 throw $ e ;
148148 }
Original file line number Diff line number Diff line change @@ -261,7 +261,12 @@ public static function tearDownAfterClass(): void {
261261 }
262262 $ dataDir = \OC ::$ server ->getConfig ()->getSystemValue ('datadirectory ' , \OC ::$ SERVERROOT . '/data-autotest ' );
263263 if (self ::$ wasDatabaseAllowed && \OC ::$ server ->getDatabaseConnection ()) {
264- $ queryBuilder = \OC ::$ server ->getDatabaseConnection ()->getQueryBuilder ();
264+ $ db = \OC ::$ server ->getDatabaseConnection ();
265+ if ($ db ->inTransaction ()) {
266+ $ db ->rollBack ();
267+ throw new \Exception ('There was a transaction still in progress and needed to be rolled back. Please fix this in your test. ' );
268+ }
269+ $ queryBuilder = $ db ->getQueryBuilder ();
265270
266271 self ::tearDownAfterClassCleanShares ($ queryBuilder );
267272 self ::tearDownAfterClassCleanStorages ($ queryBuilder );
You can’t perform that action at this time.
0 commit comments