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

AssertCount on HHVM freezes #1413

Merged
merged 1 commit into from
Aug 30, 2014
Merged

Conversation

Nyholm
Copy link
Contributor

@Nyholm Nyholm commented Aug 29, 2014

This is an issue I discovered in fabpot/php-cs-fixer repository. When I'm using $this->assertCount(1, $iterator) the scripts hangs for more than 10 minutes on HHVM... (I have not waited any longer than that)

This PR on fabpot/php-cs-fixer is a workaround for the issue.

This PR does not solve the issue. The test I added is actually passing in HHVM... I want to get some understanding why the tests freezes in PHP-CS-Fixer on HHVM.

I tried, but I could not reproduce the issue on the Finder Component. I don't know how to move forward or where the bug is...

@whatthejeff
Copy link
Contributor

Thanks for the heads up. I should have a chance to look into this over the weekend.

@whatthejeff
Copy link
Contributor

bb0c117 should prevent the infinite loop. The underlying cause was that PHPUnit tried to restore the iterator position after the assertion, but did not consider that some iterators are not rewindable.

As to why there's a difference between PHP5 and HHVM, the RecursiveDirectoryIterator from the Finder component relies on the seekable flag returned by stream_get_meta_data() to determine if the iterator should support rewinding. Unfortunately, stream_get_meta_data() does not currently work on directory streams in HHVM (see: facebook/hhvm/issues/3628).

whatthejeff added a commit that referenced this pull request Aug 30, 2014
AssertCount on HHVM freezes
@whatthejeff whatthejeff merged commit 8cd304a into sebastianbergmann:master Aug 30, 2014
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 this pull request may close these issues.

2 participants