Skip to content

Commit 98f90cd

Browse files
committed
time
1 parent 583dee6 commit 98f90cd

3 files changed

Lines changed: 7 additions & 12 deletions

File tree

datadog_checks_dev/datadog_checks/dev/docker.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,12 @@ def get_e2e_discovery_metadata(
256256
'/var/run/docker.sock:/var/run/docker.sock:ro',
257257
],
258258
'env_vars': {
259-
# Reduce the default service collection interval from 60s to speed
260-
# up tests. This needs to be set on the container instead of being
261-
# passed in to `agent check` since it's read by the
259+
# Reduce the default service collection interval and minimum process
260+
# age to speed up tests. This needs to be set on the container
261+
# instead of being passed in to `agent check` since it's read by the
262262
# system-probe(-lite) daemon.
263-
'DD_DISCOVERY_SERVICE_COLLECTION_INTERVAL': '10s',
263+
'DD_DISCOVERY_SERVICE_COLLECTION_INTERVAL': '5s',
264+
'DD_DISCOVERY_SERVICE_COLLECTION_MIN_PROCESS_AGE': '1s',
264265
},
265266
# system-probe(-lite) needs these capabilities to read /proc entries of
266267
# other processes for service discovery. Without them it falls back to

datadog_checks_dev/datadog_checks/dev/plugin/pytest.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,14 +293,7 @@ def dd_agent_check_discovery(dd_agent_check):
293293
if not e2e_testing():
294294
pytest.skip('Not running E2E tests')
295295

296-
def run(*, discovery_min_instances=1, discovery_timeout=None, process=False, **kwargs):
297-
if discovery_timeout is None:
298-
# Process autodiscovery needs to wait for the agent to recognize the
299-
# process as a service which happens after a minimum process age of 1
300-
# minute. This time can be reduced significantly once agent-side
301-
# support for reducing the minimum age via configuration is available.
302-
discovery_timeout = 90 if process else 30
303-
296+
def run(*, discovery_min_instances=1, discovery_timeout=30, process=False, **kwargs):
304297
if process:
305298
env_vars = kwargs.pop('env_vars', None) or {}
306299
# Exclude the `docker` feature so this run's autodiscovery never

datadog_checks_dev/tests/test_docker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def test_get_e2e_discovery_metadata(tmp_path):
6969
],
7070
'env_vars': {
7171
'DD_DISCOVERY_SERVICE_COLLECTION_INTERVAL': '10s',
72+
'DD_DISCOVERY_SERVICE_COLLECTION_MIN_PROCESS_AGE': '1s',
7273
},
7374
'cap_add': ['SYS_PTRACE', 'DAC_READ_SEARCH'],
7475
}

0 commit comments

Comments
 (0)