From 8603c9cdf5d82a53d12e22d0870beb691f8a6aac Mon Sep 17 00:00:00 2001 From: Alberto Vara Date: Fri, 3 Mar 2023 16:28:34 +0100 Subject: [PATCH] feat(python): update RC gunicorn behavior --- tests/remote_config/test_remote_configuration.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/remote_config/test_remote_configuration.py b/tests/remote_config/test_remote_configuration.py index 963c105b651..2025e7e25f7 100644 --- a/tests/remote_config/test_remote_configuration.py +++ b/tests/remote_config/test_remote_configuration.py @@ -190,6 +190,7 @@ class Test_RemoteConfigurationUpdateSequenceFeatures(RemoteConfigurationFieldsBa """Tests that over a sequence of related updates, tracers follow the RFC for the Features product""" request_number = 0 + python_request_number = 0 @bug(context.weblog_variant == "spring-boot-openliberty", reason="APPSEC-6721") @bug( @@ -207,7 +208,15 @@ def validate(data): rc_check_request(data, ASM_FEATURES_EXPECTED_REQUESTS[self.request_number], caching=True) - self.request_number += 1 + # TODO(Python). Gunicorn creates 2 process (main gunicorn process + X child workers). It generates two payloads + # for each request number. We're working to update this behavior in this propossal + # https://docs.google.com/document/d/1zeh7g_c_4Oj9EUuf8kQEW_qbZl9PCH4hJHiVYnoLy6I/edit + self.python_request_number += 1 + if context.library == "python" and context.weblog_variant != "uwsgi-poc": + if self.python_request_number % 2 == 0: + self.request_number += 1 + else: + self.request_number += 1 return False