Skip to content

Commit

Permalink
re-refresh database if transaction has been committed (#53997)
Browse files Browse the repository at this point in the history
  • Loading branch information
SjorsO authored Dec 26, 2024
1 parent f826d0f commit 8636996
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Illuminate/Foundation/Testing/RefreshDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ public function beginDatabaseTransaction()
$dispatcher = $connection->getEventDispatcher();

$connection->unsetEventDispatcher();

if (! $connection->getPdo()->inTransaction()) {
RefreshDatabaseState::$migrated = false;
}

$connection->rollBack();
$connection->setEventDispatcher($dispatcher);
$connection->disconnect();
Expand Down

1 comment on commit 8636996

@trovster
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My test suite runtime has changed from ~10 minutes to over 25 minutes between v11.36.1 and v11.37. I assume it is because of this change…

Please sign in to comment.