Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursion while dumping assert exception #204

Closed
hrach opened this issue Feb 1, 2015 · 4 comments · Fixed by #207
Closed

Recursion while dumping assert exception #204

hrach opened this issue Feb 1, 2015 · 4 comments · Fixed by #207

Comments

@hrach
Copy link

hrach commented Feb 1, 2015

-- FAILED: unit\services\xxxServiceTest.phpt [method=testBasicQuestionare]
   Exited with error code 255 (expected 0)

   Fatal error: Maximum execution time of 30 seconds exceeded in xxx\vendor\nette\tester\Tester\Framework\Dumper.php on line 123

   Call Stack:
       0.3035    4503752   1. Tester\Environment::handleException() xxxx\vendor\nette\tester\Tester\Framework\Environment.php:0
       0.3035    4504144   2. Tester\Dumper::dumpException() xxx\vendor\nette\tester\Tester\Framework\Environment.php:99
       0.3240    4505824   3. Tester\Dumper::saveOutput() xxx\vendor\nette\tester\Tester\Framework\Dumper.php:238
       0.3242    4506216   4. Tester\Dumper::toPhp() xxx\vendor\nette\tester\Tester\Framework\Dumper.php:312
       0.3242    4506248   5. Tester\Dumper::_toPhp() xxx\vendor\nette\tester\Tester\Framework\Dumper.php:116
       0.3246    4508448   6. Tester\Dumper::_toPhp() xxx\vendor\nette\tester\Tester\Framework\Dumper.php:195

and then it repeats Dumper lines 195, 195, 167,...

@milo
Copy link
Member

milo commented Feb 2, 2015

Serialized assertion would much help. Even privately on email.

@hrach
Copy link
Author

hrach commented Feb 2, 2015

Understood, will try.

@hrach
Copy link
Author

hrach commented Feb 3, 2015

Well. The issue is a little bit different. I call

Assert::null($a1->nextBlock);

which fails, and tries dump the property, which is actually Nextras Orm Entity, basically, it tries to dump all ORM, because depth 50 is really really great. After reducing the depth to 10, its ok, however, it generates "actual" file with over 54 000 lines.

@dg
Copy link
Member

dg commented Feb 3, 2015

Dumper code was originally taken from Nette\PhpGenerator, so depth 50 is here really too deep. It can be changed to 10.

On the other side, it should detect recursion. Do you really use so deep structures?

dg added a commit to dg/nette-tester that referenced this issue Feb 3, 2015
dg added a commit to dg/nette-tester that referenced this issue Feb 3, 2015
dg added a commit to dg/nette-tester that referenced this issue Feb 3, 2015
… only once [Closes nette#204]

Note: SplObjectStorage is not used because is buggy in PHP 5.3.3
@dg dg closed this as completed in #207 Feb 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants