You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some event subscriber for doctrine onFlush event. This subscriber performs audit logging on the every change in the doctrine entities. It has dependency on one of the Symfony's service. It works as expected.
But during codecept tests, symfony module performs rebootKernel actions. It recreate every Symfony's service in the container.
But Codecept keeps whole Doctrine and still use the same odctrine object. With doctrine event manager. Which still contains previously created instance of the my subscriber. Which still keep one of the service from previous Symfony container...
So, after every test start I have newly created container in the Symfony, but same old stack of objects for Doctrine's subscriber.It caused multiple issues: from the doubled memory usage to impossibility to reach those 'old' services used in subscriber (in the container new one created under the given id).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello here.I found interesting issue (?).
I have some event subscriber for doctrine onFlush event. This subscriber performs audit logging on the every change in the doctrine entities. It has dependency on one of the Symfony's service. It works as expected.
But during codecept tests, symfony module performs rebootKernel actions. It recreate every Symfony's service in the container.
But Codecept keeps whole Doctrine and still use the same odctrine object. With doctrine event manager. Which still contains previously created instance of the my subscriber. Which still keep one of the service from previous Symfony container...
So, after every test start I have newly created container in the Symfony, but same old stack of objects for Doctrine's subscriber.It caused multiple issues: from the doubled memory usage to impossibility to reach those 'old' services used in subscriber (in the container new one created under the given id).
Any idea how to fix it?
Beta Was this translation helpful? Give feedback.
All reactions