codeception unit test won't clean up db

I asked my question on this github issue but did not get proper answer. hope you guys can help me. here is the situation:

I’m using Yii2 module on top of Codeception’s unit tests: (note that cleanup is enabled)

class_name: UnitTester



        - Yii2:

            part: ORM



            cleanup: true

            configFile: '../config/backend/unit.php'

and working with haveRecord() and seeRecord() methods of Yii2 module:

    public function testWebsiteInsertion()





                'title' => 'test site',

                'language' => 'fa',

                'subdomain' => 'test',

                'themeId' => 1





            ['subdomain' => 'test']



Technically it should erase what it has inserted in db _ in this case website record _ after running the test. the trick is wrapping all the tests in a transaction and then rolling it back when everything is done. you can check Yii2 module’s code that does this job here:

but it is not working for me. I traced it all the way to frameworks Transaction class and there were no errors. also I’m using MySql and innodb engine for my tables. I’m really stuck and out of ideas :unsure:

I know this is old topic, but it seems problem hasn’t been solved yet. I investigated it and reported issue