Skip to content

Commit 5cecc76

Browse files
authored
Merge branch 'main' into avara1986/APPSEC-60297_reduce_flakyness_2
2 parents 903c695 + f748494 commit 5cecc76

File tree

5 files changed

+28
-54
lines changed

5 files changed

+28
-54
lines changed

.github/workflows/requirements-locks.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.gitlab-ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,17 @@ requirements_json_test:
180180
REQUIREMENTS_BLOCK_JSON_PATH: ".gitlab/requirements_block.json"
181181
REQUIREMENTS_ALLOW_JSON_PATH: ".gitlab/requirements_allow.json"
182182

183+
check_requirements_lockfiles:
184+
stage: tests
185+
needs: []
186+
extends: .testrunner
187+
script:
188+
- pip install toml==0.10.2
189+
- scripts/compile-and-prune-test-requirements
190+
- scripts/check-diff '.riot/requirements/' 'Mismatches found between .riot/requirements/*.txt and riotfile.py. Run scripts/compile-and-prune-test-requirements and commit the result.'
191+
- python scripts/requirements_to_csv.py
192+
- scripts/check-diff 'requirements.csv' 'Tracer dependency requirements in requirements.csv is out of date. Run `python scripts/requirements_to_csv.py` and commit the result.'
193+
183194
detect_circular_imports:
184195
stage: tests
185196
needs: []

ddtrace/internal/symbol_db/remoteconfig.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@
2929

3030
def _rc_callback(data: t.Sequence[Payload]):
3131
with shared_pid_file.lock_exclusive() as f:
32+
if (pid := str(os.getpid())) not in (pids := set(shared_pid_file.peekall_unlocked(f))):
33+
# Store the PID of the current process so that we know which processes
34+
# have Symbol DB enabled.
35+
shared_pid_file.put_unlocked(f, pid)
36+
3237
if (get_ancestor_runtime_id() is not None and has_forked()) or len(
33-
set(shared_pid_file.peekall_unlocked(f))
38+
pids - {pid, str(os.getppid())}
3439
) >= MAX_CHILD_UPLOADERS:
3540
log.debug("[PID %d] SymDB: Disabling Symbol DB in child process", os.getpid())
3641
# We assume that forking is being used for spawning child worker
@@ -44,10 +49,6 @@ def _rc_callback(data: t.Sequence[Payload]):
4449

4550
return
4651

47-
# Store the PID of the current process so that we know which processes
48-
# have Symbol DB enabled.
49-
shared_pid_file.put_unlocked(f, str(os.getpid()))
50-
5152
for payload in data:
5253
if payload.metadata is None:
5354
continue
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
fixes:
3+
- |
4+
dynamic instrumentation: fixed an issue that prevented autocomplete
5+
information to be extracted from the running application.

tests/internal/symbol_db/test_symbols.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,12 @@ def test_symbols_fork_uploads():
319319

320320
for _ in range(10):
321321
if not (pid := os.fork()):
322-
_rc_callback(rc_data)
323-
assert SymbolDatabaseUploader.is_installed() != (
324-
get_ancestor_runtime_id() is not None and forksafe.has_forked()
325-
)
322+
# Call the RC callback multiple times to check for stability
323+
for i in range(10):
324+
_rc_callback(rc_data)
325+
assert SymbolDatabaseUploader.is_installed() != (
326+
get_ancestor_runtime_id() is not None and forksafe.has_forked()
327+
), f"iteration {i} is stable"
326328
os._exit(0)
327329

328330
pids.append(pid)

0 commit comments

Comments
 (0)