backend-tech-forge / benchmark

A enterprise level performance testing solution. Taking inspiration from nGrinder, this project aims to develop a Spring Boot application mirroring nGrinder's functionality as closely as feasible.
MIT License
4 stars 0 forks source link

`@Transactional` and `@SpringBootTest` can be cooperative but not with `RANDOM_PORT` #80

Closed ghkdqhrbals closed 7 months ago

ghkdqhrbals commented 7 months ago

This issue is based on https://www.youtube.com/watch?v=yRNkF-5TeYU&t=1138

You can check all countermeasures in the above link.

@Transactional annotation is very common rollback for testing each of the methods. When u r using @Transactional annotation with @SpringBootTest, all thing will be fine. But! with the RANDOM_PORT?, not working.

@Transactional
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)