dmaicher / doctrine-test-bundle

Symfony bundle to isolate your app's doctrine database tests and improve the test performance
MIT License
1.08k stars 60 forks source link

fix issue 191 by not registering event listener manually #194

Closed dmaicher closed 2 years ago

dmaicher commented 2 years ago

Fixes https://github.com/dmaicher/doctrine-test-bundle/issues/191

bobvandevijver commented 2 years ago

@dmaicher It looks like this change broke our unit tests with the following message: "There is no active transaction".

This normally has to do with the DDL statement causing an implicit commit on certain database platforms (of which the behaviour changed with PHP8), but that does not explain why the patch upgrade from 6.7.2 to 6.7.3 would start causing this...

Do you have any clue on why this might happen?

dmaicher commented 2 years ago

@bobvandevijver hm not really. I had some similar issues when upgrading to PHP8 though.

Are you able to provide a minimal reproducer?

bobvandevijver commented 2 years ago

Ok, I found the cause: Sentry. When I disable that bundle, the error is no longer triggered. It also wraps the connection, so the combination of both bundles does not play that nice...

I've now only enabled the Sentry bundle for the prod env, instead of only setting the DSN for the prod env. That solves it for me, but you might use this case as there are probably other use cases out there where the connection is wrapped.

dmaicher commented 2 years ago

@bobvandevijver can you open a new issue please? I will try to take a look