Skip to content

Commit

Permalink
Merge pull request #638 from mendix/develop
Browse files Browse the repository at this point in the history
Release 2023-06-02
  • Loading branch information
sailhenz authored Jun 2, 2023
2 parents 30092b6 + a49f32f commit c4ba778
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
5 changes: 5 additions & 0 deletions buildpack/core/nginx.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def update_config():
samesite_cookie_workaround_enabled=samesite_cookie_workaround_enabled,
locations=_get_locations(),
default_headers=_get_http_headers(),
nginx_keepalive_timeout=_get_nginx_keepalive_timeout(),
nginx_port=str(util.get_nginx_port()),
runtime_port=str(util.get_runtime_port()),
admin_port=str(util.get_admin_port()),
Expand Down Expand Up @@ -136,6 +137,10 @@ def update_config():
_generate_password_file({"MxAdmin": security.get_m2ee_password()})


def _get_nginx_keepalive_timeout():
return os.environ.get("NGINX_KEEPALIVE_TIMEOUT", "30")


def _get_proxy_buffer_size():
return os.environ.get("NGINX_PROXY_BUFFER_SIZE", None)

Expand Down
4 changes: 2 additions & 2 deletions dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dependencies:
logs:
mendix-logfilter:
artifact: logs/mendix-logfilter-{{version}}.tar.gz
version: 0.0.2
version: 0.0.3
mendix:
mx-agent:
artifact: mx-agent/mx-agent-v{{ version }}.jar
Expand Down Expand Up @@ -84,7 +84,7 @@ dependencies:
newrelic:
agent:
artifact: newrelic/newrelic-java-{{ version }}.zip
version: 6.2.1
version: 6.5.4
nginx:
artifact: nginx_{{ version }}_linux_x64_cflinuxfs3_{{ commit }}.tgz
commit: f0918d6b
Expand Down
2 changes: 1 addition & 1 deletion etc/nginx/conf/nginx.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ http {
gzip_types text/plain text/css text/js text/xml text/javascript application/javascript application/x-javascript application/json application/xml application/xml+rss;

tcp_nopush on;
keepalive_timeout 30;
keepalive_timeout {{ nginx_keepalive_timeout }};
absolute_redirect off;
server_tokens off;

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class TestCaseLogging(basetest.BaseTest):
def setUp(self):
super().setUp()
self.stage_container(
"sample-6.2.0.mda",
"Mendix8.1.1.58432_StarterApp.mda",
env_vars={
"LOGGING_CONFIG": json.dumps({"Jetty": "TRACE"}),
"LOG_RATELIMIT": 500,
Expand Down
18 changes: 10 additions & 8 deletions tests/integration/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ class TestCaseEmitMetrics(basetest.BaseTestWithPostgreSQL):
# threads work as expected, just not that the metrics get to the right
# destination.
def test_read_metrics_in_logs(self):
self.stage_container("sample-6.2.0.mda", env_vars={"METRICS_INTERVAL": "10"})
self.stage_container(
"Mendix8.1.1.58432_StarterApp.mda", env_vars={"METRICS_INTERVAL": "10"}
)
self.start_container()

assert self.await_string_in_recent_logs("MENDIX-METRICS: ", 10)
Expand All @@ -23,7 +25,7 @@ def test_read_metrics_in_logs(self):

def test_free_apps_metrics(self):
self.stage_container(
"sample-6.2.0.mda",
"Mendix8.1.1.58432_StarterApp.mda",
env_vars={"METRICS_INTERVAL": "10", "PROFILE": "free"},
)
self.start_container()
Expand All @@ -34,10 +36,10 @@ def test_free_apps_metrics(self):
self.assert_string_in_recent_logs("named_user_sessions")


class TestNewMetricsFlows(basetest.BaseTestWithPostgreSQL):
class TestNewMetricsFlows(basetest.BaseTest):
def test_fallback_flow_when_server_unreachable(self):
self.stage_container(
"sample-6.2.0.mda",
"Mendix8.1.1.58432_StarterApp.mda",
env_vars={
"METRICS_INTERVAL": "10",
"BYPASS_LOGGREGATOR": "True",
Expand All @@ -53,7 +55,7 @@ def test_fallback_flow_when_server_unreachable(self):

def test_fallback_when_no_url_set(self):
self.stage_container(
"sample-6.2.0.mda",
"Mendix8.1.1.58432_StarterApp.mda",
env_vars={"METRICS_INTERVAL": "10", "BYPASS_LOGGREGATOR": "True"},
)
self.start_container()
Expand All @@ -66,7 +68,7 @@ def test_fallback_when_no_url_set(self):

def test_fallback_with_bad_environment_variables(self):
self.stage_container(
"sample-6.2.0.mda",
"Mendix8.1.1.58432_StarterApp.mda",
env_vars={
"METRICS_INTERVAL": "10",
"BYPASS_LOGGREGATOR": "this will not coerce to a boolean",
Expand All @@ -79,11 +81,11 @@ def test_fallback_with_bad_environment_variables(self):

def test_posting_metrics_works(self):
self.stage_container(
"sample-6.2.0.mda",
"Mendix8.1.1.58432_StarterApp.mda",
env_vars={
"METRICS_INTERVAL": "10",
"BYPASS_LOGGREGATOR": "True",
"TRENDS_STORAGE_URL": "http://httpbin.org/post",
"TRENDS_STORAGE_URL": "http://postman-echo.com/post",
},
)
self.start_container()
Expand Down

0 comments on commit c4ba778

Please sign in to comment.