EcomDev_PHPUnit icon indicating copy to clipboard operation
EcomDev_PHPUnit copied to clipboard

Hangs several times due to not unlocked tables

Open ScreamingDev opened this issue 12 years ago • 4 comments

I have the fixture

eav:
  catalog_product:
    - entity_id: 1
      type_id: simple
      sku: ps4
      website_ids:
        - base
      price: 12.99
      status: 1 # Enabled
      visibility: 4 # Catalog & Search

And a dispatch like this

$route = 'catalog/product/view';
        $this->dispatch($route, array('_store' => 'default', 'id' => 1));

Every time the test fails due to lock timeout if I do not UNLOCK TABLES during the test several times.

ScreamingDev avatar Sep 22 '13 18:09 ScreamingDev

/htdocs/app/code/community/EcomDev/PHPUnit/Model/Fixture/Processor/Eav.php:101

foreach ($eavLoaders as $eavLoader){
            $eavLoader->runRequiredIndexers();
        }

is the problem. In addition you reindex after every single addition of a product. This takes very much time.

ScreamingDev avatar Sep 22 '13 18:09 ScreamingDev

I always have to add an @doNotIndexAll to make it work.

/**
     * Tests EveryProductHasSpecialLinksToManage.
     *
     * @testdox ProductFoo
     * @doNotIndexAll
     * @loadFixture eav_catalog_product
     *
     * @return null
     */

ScreamingDev avatar Sep 22 '13 18:09 ScreamingDev

You can use @loadSharedFixture annotation for class, to speed up your tests. In new version there will be smarter way to control indexation loading of data and more smarter indexation model.

IvanChepurnyi avatar Sep 22 '13 22:09 IvanChepurnyi

That would be great. Everything I write is related to the current dev branch.

ScreamingDev avatar Sep 23 '13 06:09 ScreamingDev