Commit e05d170
committed
test(mysql): enhance transaction test coverage with 27 new test functions
Add comprehensive transaction tests covering:
- Isolation levels (READ_COMMITTED, SERIALIZABLE, REPEATABLE_READ):
* Non-repeatable read scenarios
* Phantom read prevention
* Consistent snapshot verification
- Deadlock detection and retry:
* Two-table deadlock scenarios
* Same-table deadlock scenarios
* Automatic retry mechanism
- Deep nested transactions:
* 7-level nesting with full commit
* 7-level nesting with partial rollback
* 10-level maximum depth testing
- Savepoint enhancements:
* Multiple savepoints in single transaction
* Rollback to non-existent savepoint error handling
- Concurrent operations:
* Concurrent inserts (10 goroutines)
* Concurrent updates to same record
- Mixed propagation modes:
* REQUIRES_NEW + NESTED + REQUIRED in single flow
- Transaction lifecycle:
* Rollback after commit (error)
* Commit after rollback (error)
* Operations after commit/rollback (error)
- Context integration:
* Timeout handling
* Cancellation handling
- Edge cases:
* Empty transaction with no operations
* Large batch insert (1000 records)
* Large batch update (500 records)
- Read-only transactions:
* Update in read-only transaction (error)
* Delete in read-only transaction (error)
ref gogf#46891 parent c8a11f7 commit e05d170
1 file changed
Lines changed: 852 additions & 0 deletions
0 commit comments