cancel
Showing results for 
Search instead for 
Did you mean: 

Object manager taking too long to create/inject a dependency

Object manager taking too long to create/inject a dependency

Hello all, I am trying to inject a model via Object Manager in an integration test. The injection/creation of object takes forever and never ends. However, when I try print_r before the calling get/create on object manager instance, I see the dump response on the console and test ends so the issue is clearly not with the tests not running but rather with Object manager.

 

class RemoveAbandonedCartDataOlderThanAMonthCronTest extends AbstractController {
   protected function setUp() {
        parent::setUp();

        $this->resourceConnection = $this->_objectManager->get('Abc\AbandonedCart\Model\AbandonedCart');
   }
}

 

Any help would be greatly appreciated. Thanks

2 REPLIES 2

Re: Object manager taking too long to create/inject a dependency

Hello @basheer_A ,

please check the below link once,

 

https://magento.stackexchange.com/a/121089/72475 

Let me know if you still face issues.

 

Thank you 

Problem solved? accept a solution and click kudos

Re: Object manager taking too long to create/inject a dependency

Hi @smita_kagwade , thank you for your reply. However, I am already creating an integration test which has by default ObjectManager available but seems it gets stuck due while creating dependencies.