[nodejs] fix remote config polling slowing down multiple tests#6808
Open
[nodejs] fix remote config polling slowing down multiple tests#6808
Conversation
Contributor
|
|
|
✨ Fix all issues with BitsAI or with Cursor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
That was slowing everything down.
Changes
Fix remote config polling slowing down multiple tests.
Explanation from Claude when I originally asked it to fix
APPSEC_RUNTIME_ACTIVATIONandAPPSEC_AUTO_EVENTS_RCbeing the slowest tests:Two changes made:
utils/_context/_scenarios/init.py — Added DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS: "0.5" to APPSEC_RUNTIME_ACTIVATION. Without this, each apply() call waited for the default ~5s poll cycle before the tracer acknowledged the config. The scenario had 58 total apply() calls across its test files (34 in test_remote_config_rule_changes.py alone), making this the dominant bottleneck.
utils/_remote_config.py:144 — Reduced time.sleep(2) to time.sleep(0.5). This sleep runs after every send_state() call to give subprocesses time to catch up. With a 0.5s poll interval, 0.5s (one poll cycle) is sufficient — any worker process that hadn't applied yet will poll within that window. The old 2s value was actually already too short for scenarios using the default 5s interval, but 4× too long for scenarios using 0.5s.
Estimated speedup:
APPSEC_RUNTIME_ACTIVATION: each apply goes from ~5s + 2s = ~7s → ~0.5s + 0.5s = ~1s — roughly 7× faster
APPSEC_AUTO_EVENTS_RC: each apply goes from ~0.5s + 2s = ~2.5s → ~0.5s + 0.5s = ~1s — roughly 2.5× faster
I then asked it to apply the same fix to everything else.
Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present