-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add unit tests around WEB_CONCURRENCY #876
Add unit tests around WEB_CONCURRENCY #876
Conversation
c98325e
to
52ff595
Compare
It appears my understanding of what environment variables are set when you run a I understand if this change isn't wanted, but it would be nice to see consistent behavior between different Heroku-created buildpacks. To me, the setting of the value unless it is already set leads to more understandability. |
This is already the behavior:
Maybe keep the unit tests, they can't hurt, and remove the other two changes? ;) |
@michaelherold Thanks for the PR! As @dzuelke said, the extra coverage would be great if you could fix the tests. Otherwise, do you mind if we close this? |
52ff595
to
d539e03
Compare
🤦 So it is. It was very easy to miss that since it's hidden in the function. And since it does some checking against the value, my sentinel value was being ignored.
I removed everything but the tests, but Hatchet is still failing to work correctly on CI. I don't know why that's happening. |
@michaelherold These are tests that we run internally to check integration with the Heroku platform. I recently moved the tests to Circle CI where I am not able to figure out how to run the test myself (they will continue to fail because you don't have access to the Heroku creds). If I can't figure this out, I'll open a pull request a run the tests on the next release. Thanks! |
@michaelherold Can you rebase this? I can merge it it once it matches the base branch. Thanks! |
@michaelherold can you rebase this? |
WEB_CONCURRENCY should be allowed to be set prior to the `profile.d` scripts running. This change adds tests to make sure we do not accidentally clobber preset values. These tests were extracted from a different change that duplicated behavior for WEB_CONCURRENCY handling. See the [associated PR][1] for more information around the discussion. [1]: heroku#876
d539e03
to
2f28f2e
Compare
Done!
…On Tue, Jan 19, 2021 at 3:22 PM Danielle Adams ***@***.***> wrote:
@michaelherold <https://github.com/michaelherold> can you rebase this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#876 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADHXAPFPAZ2I3OL4MKHNODS2XZY5ANCNFSM4UT67GUA>
.
|
This buildpack is inconsistent with the heroku/ruby buildpack's setting
of WEB_CONCURRENCY. It tries to guess a reasonable value for
WEB_CONCURRENCY, even if one is set manually in the application's
configuration.
Since this value is used, by default, by the Puma web server, this
behavior is undesirable. Newer Rails applications use both the
heroku/nodejs buildpack and the heroku/ruby buildpack because Rails
manages assets through Webpack.
This change respects any value that the customer sets for
WEB_CONCURRENCY via
heroku config:set
instead of blindly overwritingthe value. With this behavior, the customer can better control the
process-level concurrency for their applications.
I verified that this behavior does, indeed, occur by doing the
following:
heroku config:set WEB_CONCURRENCY=2 -a <myapp>
heroku run -a <myapp> bash
echo $WEB_CONCURRENCY
For step (3), the value was set to
WEB_CONCURRENCY=1
instead of theexpected
WEB_CONCURRENCY=2
. I do not believe the buildpacks have anorder-dependence since the Ruby one does not override a set value.