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
Today I was looking for memory leaks in our application's test suite and found out that the storage in https://github.com/Payum/Core/blob/43954de6415e1a29fa09d7ca7949b071741afbc6/Bridge/Twig/TwigUtil.php#L9 keeps growing and is never cleared. This is not a big deal in a casual request-response lifecycle but is a big pain in a functional test suite. So far our solution is clearing the storage with our own class
<?php
declare(strict_types=1);
namespace App\Tests\Payum;
class TwigUtil extends \Payum\Core\Bridge\Twig\TwigUtil
{
public static function clearStorage(): void
{
if (null === static::$storage) {
return;
}
static::$storage->removeAll(static::$storage);
}
}
which we call in tests' tearDown method however it'd be great to get rid of the memory leak at its source.
The text was updated successfully, but these errors were encountered:
Today I was looking for memory leaks in our application's test suite and found out that the storage in https://github.com/Payum/Core/blob/43954de6415e1a29fa09d7ca7949b071741afbc6/Bridge/Twig/TwigUtil.php#L9 keeps growing and is never cleared. This is not a big deal in a casual request-response lifecycle but is a big pain in a functional test suite. So far our solution is clearing the storage with our own class
which we call in tests'
tearDown
method however it'd be great to get rid of the memory leak at its source.The text was updated successfully, but these errors were encountered: