kenjis / ci-phpunit-test

An easier way to use PHPUnit with CodeIgniter 3.x.
http://kenjis.github.io/ci-phpunit-test/
MIT License
587 stars 195 forks source link

How to clear RAM memory after run testcase in testsuite? #404

Closed i-am-nikola closed 1 year ago

i-am-nikola commented 1 year ago

Every time I run a test suite, the data from the previous test cases are not cleared, causing memory usage, Thank you!

kenjis commented 1 year ago

I don't understand your situation. What is the exact error message? What is the data?

i-am-nikola commented 1 year ago

I have a test suite with 100 test cases, and after running that test suite, my RAM lost 5GB, which means on average each test case takes 50MB. I want to release the memory after finishing each test case. Specifically, I want to ensure that running all 100 test cases will only consume 50MB instead of 5GB.

kenjis commented 1 year ago

5GB seems to be too big. But it is not a issue in ci-phpunit-test, but in your test code.

I want to release the memory after finishing each test case.

Release the memory with the normal ways in PHP programming.

Run tests by a directory or by a test file, identify tests that consume a lot of memory and have not been freed, and add code to free memory when the test is finished.