Skip to content

Commit afd29e2

Browse files
authored
Merge pull request #529 from magento-performance/ACPT-1184
ACPT-1184: Fix classes found by GraphQlStateTest
2 parents 405eb07 + 121046a commit afd29e2

File tree

2 files changed

+30
-44
lines changed

2 files changed

+30
-44
lines changed

dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php

Lines changed: 22 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,21 @@
3030
Magento\Framework\GraphQl\Query\Fields::class => null,
3131
],
3232
'*' => [
33-
Magento\Framework\Webapi\Response::class => null,
34-
Magento\TestFramework\App\Filesystem::class => null,
3533
Magento\TestFramework\Interception\PluginList::class => null,
3634
// memory leak, wrong sql, potential issues
37-
Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Deferred\Product::class => null,
38-
Magento\ConfigurableProductGraphQl\Model\Variant\Collection::class => null,
39-
Magento\ConfigurableProductGraphQl\Model\Options\Collection::class => null,
40-
Magento\Framework\Url\QueryParamsResolver::class => null,
41-
Magento\Framework\Event\Config\Data::class => null, // TODO: reset when config is reset from poison pill
35+
Magento\Framework\Event\Config\Data::class => null,
4236
Magento\Framework\App\AreaList::class => null,
4337
'customRemoteFilesystem' => null,
4438
Magento\Store\App\Config\Type\Scopes::class => null,
4539
Magento\Framework\Module\Dir\Reader::class => null,
4640
Magento\Framework\App\Language\Dictionary::class => null,
47-
Magento\Framework\Code\Reader\ClassReader::class => null,
4841
Magento\Framework\ObjectManager\ConfigInterface::class => null,
4942
Magento\Framework\App\Cache\Type\Config::class => null,
5043
Magento\Framework\Interception\PluginListGenerator::class => null,
5144
Magento\TestFramework\App\Config::class => null,
5245
Magento\TestFramework\Request::class => null,
5346
Magento\Framework\View\FileSystem::class => null,
5447
Magento\Framework\App\Config\FileResolver::class => null,
55-
Magento\Framework\Module\Manager::class => null,
56-
Magento\Framework\Logger\LoggerProxy::class => null,
5748
Magento\TestFramework\ErrorLog\Logger::class => null,
5849
'translationConfigSourceAggregated' => null,
5950
Magento\Framework\App\Request\Http\Proxy::class => null,
@@ -67,40 +58,28 @@
6758
Magento\Framework\Locale\Resolver\Proxy::class => null,
6859
Magento\MediaStorage\Helper\File\Storage\Database::class => null,
6960
Magento\Framework\App\Cache\Proxy::class => null,
70-
Magento\Framework\Translate::class => null, // TODO: ?
71-
Magento\Store\Model\StoreManager::class => null, // TODO: This is reset with poison pill, right?
72-
Magento\Framework\App\Http\Context::class => null, // TODO: This should probably be cleaned up, right?!?
73-
Magento\Customer\Model\Session\Storage::class => null, // TODO: Didn't Aakash or Kasian fix this already?
74-
Magento\TestFramework\Response::class => null, // TODO: Why is this in the ObjectManager?!?
75-
Magento\Store\Model\WebsiteRepository::class => null, // TODO: What is going on here?!?
76-
Magento\Framework\Locale\Resolver::class => null, // TODO: do we need to fix this?
77-
Magento\Theme\Model\ResourceModel\Theme\Collection::class => null, // TODO
78-
Magento\Store\Model\GroupRepository::class => null, // TODO: see what this is
79-
Magento\Store\Model\StoreRepository::class => null, // TODO: could be fixed already with Poison Pill
80-
Magento\Framework\View\Design\Fallback\RulePool::class => null, // TODO: Looks like we need to reset?
81-
Magento\Framework\View\Asset\Repository::class => null, // TODO: Looks okay, but need to confirm
82-
Magento\Framework\HTTP\Header::class => null, // TODO: I believe Aakash is currently working on this
83-
Magento\Framework\App\Route\Config::class => null, // TODO: reset when Poison Pill causes config to reset.
84-
Magento\Customer\Model\ResourceModel\Attribute::class => null, // TODO
85-
Magento\Framework\DataObject\Copy\Config\Converter::class => null, // TODO
86-
Magento\Framework\DataObject\Copy\Config\SchemaLocator::class => null, // TODO
87-
Magento\Framework\DataObject\Copy\Config\Reader::class => null, // TODO
88-
Magento\Framework\DataObject\Copy\Config\Data::class => null, // TODO
89-
Magento\Store\Model\System\Store::class => null, // TODO
90-
Magento\AwsS3\Driver\CredentialsCache::class => null, // TODO
91-
Magento\Eav\Model\Config::class => null, // TODO: Does this work properly after config changes?
92-
'AssetPreProcessorPool' => null, // TODO: see what this is
93-
Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\AttributeProvider::class => null, // FIXME: bug?
94-
Magento\GraphQl\Model\Query\Context::class => null, // FIXME: I think this one needs to be reset. Check!
95-
Magento\GraphQl\Model\Query\ContextFactory::class => null, // FIXME: I think this one needs to be reset. Check!
96-
'viewFileMinifiedFallbackResolver' => null, // FIXME: remove after fix for Framework\View\Asset\Minification
97-
Magento\Framework\View\Asset\Minification::class => null, // FIXME: $configCache must be reset
98-
// FIXME: We MUST NOT dependency inject collections.
99-
// This needs to be fixed in Magento\CatalogGraphQl\Model\Config\SortAttributeReader
61+
Magento\Framework\Translate::class => null,
62+
Magento\Store\Model\StoreManager::class => null,
63+
Magento\Framework\App\Http\Context::class => null,
64+
Magento\TestFramework\Response::class => null,
65+
Magento\Store\Model\WebsiteRepository::class => null,
66+
Magento\Framework\Locale\Resolver::class => null,
67+
Magento\Store\Model\GroupRepository::class => null,
68+
Magento\Store\Model\StoreRepository::class => null,
69+
Magento\Framework\View\Design\Fallback\RulePool::class => null,
70+
Magento\Framework\View\Asset\Repository::class => null,
71+
Magento\Framework\HTTP\Header::class => null,
72+
Magento\Framework\App\Route\Config::class => null,
73+
Magento\Store\Model\System\Store::class => null,
74+
Magento\AwsS3\Driver\CredentialsCache::class => null,
75+
Magento\Eav\Model\Config::class => null,
76+
'AssetPreProcessorPool' => null,
77+
Magento\GraphQl\Model\Query\ContextFactory::class => null,
78+
'viewFileMinifiedFallbackResolver' => null,
79+
Magento\Framework\View\Asset\Minification::class => null,
10080
Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection::class => null,
101-
Magento\Framework\Url::class => null, // FIXME: This need reseter!!
102-
Magento\Quote\Model\Quote\Address\Total\Collector::class => null, // FIXME: mutable state that needs to be reset
103-
Magento\Framework\HTTP\PhpEnvironment\RemoteAddress::class => null, // FIXME: caching from $request
81+
Magento\Framework\Url::class => null,
82+
Magento\Framework\HTTP\PhpEnvironment\RemoteAddress::class => null,
10483
],
10584
'' => [
10685
],

lib/internal/Magento/Framework/Translate.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
use Magento\Framework\App\ObjectManager;
1212
use Magento\Framework\Filesystem\Driver\File;
1313
use Magento\Framework\Filesystem\DriverInterface;
14+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1415

1516
/**
1617
* Translate library
1718
*
1819
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1920
* @SuppressWarnings(PHPMD.TooManyFields)
2021
*/
21-
class Translate implements \Magento\Framework\TranslateInterface
22+
class Translate implements \Magento\Framework\TranslateInterface, ResetAfterRequestInterface
2223
{
2324
const CONFIG_AREA_KEY = 'area';
2425
const CONFIG_LOCALE_KEY = 'locale';
@@ -601,4 +602,10 @@ private function getSerializer()
601602
}
602603
return $this->serializer;
603604
}
605+
606+
public function _resetState(): void
607+
{
608+
$this->_config = [];
609+
$this->_data = [];
610+
}
604611
}

0 commit comments

Comments
 (0)