code-distortion / adapt

A Laravel package that builds databases for your tests, improving their speed
MIT License
24 stars 3 forks source link

Transaction error #9

Open qwerkon opened 1 year ago

qwerkon commented 1 year ago

Description:

Hi, when I try to run tests using the command vendor/bin/phpunit, it throws an error related to transactions.

Logs:

ADAPT DEBUG: ┌── ADAPT (v0.12.11) ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
ADAPT DEBUG: │ Preparing a database for connection "mysql_testing"                                                                                                             │
ADAPT DEBUG: │ For test "Tests\Unit\TestJobTest::test_job_returns_mode"                                                                                                        |
ADAPT DEBUG: └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
ADAPT DEBUG: ┌── Software ──────────────────────────────────────┐
ADAPT DEBUG: │ OS:      Linux                                   │
ADAPT DEBUG: │ PHP:     8.1.24                                  │
ADAPT DEBUG: │ Laravel: 9.52.15                                 │
ADAPT DEBUG: │ PHPUnit: 9.6.11                                  │
ADAPT DEBUG: │ Adapt:   0.12.11                                 │
ADAPT DEBUG: │ MySQL:   10.10.2-MariaDB-1:10.10.2+maria~ubu2204 │
ADAPT DEBUG: └──────────────────────────────────────────────────┘
ADAPT DEBUG: ┌── Build Sources ───────────────────────────────────────┐
ADAPT DEBUG: │ Initial imports:   None                                │
ADAPT DEBUG: │ Migrations:        "/var/www/html/database/migrations" │
ADAPT DEBUG: │ Seeder:            "DatabaseSeeder"                    │
ADAPT DEBUG: │ Snapshots enabled? No                                  │
ADAPT DEBUG: └────────────────────────────────────────────────────────┘
ADAPT DEBUG: ┌── Build Settings ──────────────────────────────────────┐
ADAPT DEBUG: │ Using scenarios?    No                                 │
ADAPT DEBUG: │ Re-use method:      Transaction                        │
ADAPT DEBUG: │ Verify db after?    No                                 │
ADAPT DEBUG: │ For a browser test? No                                 │
ADAPT DEBUG: │ Parallel testing?   No                                 │
ADAPT DEBUG: │ Build-checksum:     "8008831e68a2ad7f2354766cd591e81e" │
ADAPT DEBUG: │ Snapshot-checksum:  "e0153c44b18f9325b8f2c1af973e4398" │
ADAPT DEBUG: │ Scenario-checksum:  n/a                                │
ADAPT DEBUG: └────────────────────────────────────────────────────────┘
ADAPT DEBUG: ┌── Resolved Database ────────┐
ADAPT DEBUG: │ Connection: "mysql_testing" │
ADAPT DEBUG: │ Driver:     "mysql"         │
ADAPT DEBUG: │ Host:       "mysql"         │
ADAPT DEBUG: │ Database:   "tests"         │
ADAPT DEBUG: └─────────────────────────────┘
ADAPT DEBUG: Leaving the database for connection "mysql_testing" unchanged as "tests"
ADAPT DEBUG: The existing database "tests" can be reused (2ms)
ADAPT ERROR: ┌── An Exception Occurred - Illuminate\Database\QueryException ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
ADAPT ERROR: │ SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction (SQL: UPDATE `____adapt____` SET `scenario_checksum` = ?, `last_used` = 2023-10-13 11:43:04) │
ADAPT ERROR: │ /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 760                                                                                                │
ADAPT ERROR: │                                                                                                                                                                                          │
ADAPT ERROR: │ Previous Exception - PDOException                                                                                                                                                        │
ADAPT ERROR: │ SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction                                                                                              │
ADAPT ERROR: │ /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 570                                                                                                │
ADAPT ERROR: └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘