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

Blackfire issue on CI #532

Open
VincentPeraud opened this issue Jan 21, 2022 · 5 comments
Open

Blackfire issue on CI #532

VincentPeraud opened this issue Jan 21, 2022 · 5 comments
Assignees
Labels

Comments

@VincentPeraud
Copy link

VincentPeraud commented Jan 21, 2022

Hi,

I'm facing an issue with blackfire on heroku CI.

As described in this page https://blackfire.io/docs/integrations/paas/heroku I have added ext-blackfire package in my composer.json

I have configured my app.json heroku file as below:

image

But in my heroku CI run, I can see the "Test setup step" echo but test step below still remain pending...

image

Actually the step is triggered but 2 hours after.

I tried to run in debug mode in my term with "heroku ci:debug" command, and I noticed this error at the end of the test setup step :

image

It's like blackfire agent:start has been executed twice, and I had to Ctrl+C to get my term back.

I asked to Blackfire support and they told me that it was an issue with heroku/php build pack, so as they asked my I'm creating that issue, tagging @lolautruche

Thanks for your help,
Vince.

@dzuelke dzuelke added the bug label Jan 24, 2022
@dzuelke dzuelke self-assigned this Jan 24, 2022
@dzuelke
Copy link
Contributor

dzuelke commented Jan 24, 2022

Will investigate. There are unfortunately minor differences between the "normal" and "interactive" CI runs (interactive TTY, and a wrapping Shell process, mostly) that I think are causing the difference in behavior here (hang on test-setup vs error).

The real question, however, is... should APM extensions even be enabled in CI? The automatic installs are skipped for CI...

@lolautruche
Copy link

The real question, however, is... should APM extensions even be enabled in CI? The automatic installs are skipped for CI...

It's more about the profiler, which does make sense in the CI as Blackfire allows you to run performance tests, whether using scenarios or within unit tests.

@VincentPeraud
Copy link
Author

I finally managed to find a workaround, I added pkill blackfire at the end of my test setup script and my test script. (Thank you @tucksaun)

@tucksaun
Copy link

@dzuelke the issue appears to be that the Blackfire agent is started by the profile.d scripts (see https://github.com/heroku/heroku-buildpack-php/blob/main/support/build/blackfire#L46-L67).
But nothing is responsible to stop it when the session is done so it hangs.

I agree with @lolautruche: having the Agent in the CI can be interesting for users who want to run performance tests.
But this problem probably also impacts users who just happen to have Blackfire for production and use Heroku CI.
So I believe the buildpack should either try to take care of shutting down Blackfire agent or let users manually start and stop it during the test phase.

@lolautruche
Copy link

Glad you found a workaround @VincentPeraud (and thanks @tucksaun)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants