-
Notifications
You must be signed in to change notification settings - Fork 60
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
fix test setup with symfony backend #201
Conversation
Nice, you’re going to solve this one? 👍 |
env: VARNISH_VERSION=3.0 | ||
- php: 5.3 | ||
env: SYMFONY_VERSION=2.3.* VARNISH_VERSION=4.0 COMPOSER_FLAGS="--prefer-lowest" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes in this file need to be reverted, just to have faster cycles with travis.
not sure. i just wanted to get started on it. if the next run does not provide helpful information i will leave it be for now. i now have a hhvm setup with apache 2.2 and it ends up in
|
@@ -21,4 +21,4 @@ | |||
$request = Request::createFromGlobals(); | |||
$response = $kernel->handle($request); | |||
$response->send(); | |||
$kernel->terminate($request, $response); | |||
//$kernel->terminate($request, $response); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, so indeed at the time we try to terminate the kernel, the dispatcher inside the kernel is set to null. i have no idea why or even how this can happen.
it would sound like a general symfony + hhvm problem, but google does not bring up the problem.
Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function dispatch() on a non-object (NULL)' in /vagrant_data/FOSHttpCache/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php:86
Stack trace:
#0 /vagrant_data/FOSHttpCache/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(245): Symfony\\Component\\HttpKernel\\HttpKernel->terminate()
#1 /vagrant_data/FOSHttpCache/tests/Functional/Fixtures/web/symfony.php(24): Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache->terminate()
#2 {main}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very weird. But this is the last problem, right? Otherwise it's green.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this is the only problem. i commented this line as i did not manage to get hhvm to log anything on travis. locally, it logged what i pasted in my comment. and i really can't explain why that could ever happen. i checked the codebase, nothing is assigning to $this->dispatcher, also not the extending classes...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious if changing the code as suggested in symfony/symfony-standard#658 does the trick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it makes the tests green, but only because the response is sent before hhvm crashes... maybe we do not need to bother for FOSHttpCache, if we do not rely on any kernel terminate events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh hell, i dug some more. the dispatcher is always null. in symfony, you create a Kernel which gets HttpKernel from the container. the event dispatcher is created and injected by the container... i need to fix the setup of the kernel then.
/** | ||
* A simplistic kernel that is actually the whole application. | ||
*/ | ||
class AppKernel implements HttpKernelInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so actually extending the HttpKernel was only creating problems. the simplistic kernel just needs a handle method!
this hopefully will get green now. i think the problem exists on all php versions, but php still sends the response while hhvm immediately aborts on such a fatal error and does not flush the response body, which made us see the mistake. having terminate made no sense, and was not supposed to work (i had an empty constructor to not call the parent constructor which would expect the event dispatcher... so it was all my fault and i got confused) |
fix test setup with symfony backend
Nice one! Glad this is solved. 😄 |
follow up of #193