Skip to content

Fix tests/appsec/test_conf.py#3865

Merged
jandro996 merged 8 commits into
mainfrom
alejandro.gonzalez/java-easy-wins-w4-5
Jan 24, 2025
Merged

Fix tests/appsec/test_conf.py#3865
jandro996 merged 8 commits into
mainfrom
alejandro.gonzalez/java-easy-wins-w4-5

Conversation

@jandro996
Copy link
Copy Markdown
Member

@jandro996 jandro996 commented Jan 21, 2025

Motivation

Fix easy wins in tests/appsec/test_conf.py:

  • test_disabled
  • test_waf_timeout

The tests were unreliable as they only checked for the absence of an AppSec event, this is not enough as an unimplemented endpoint or a bad request pass the test

For instance the intention in test_waf_timeout is to verify that there is no event because of a timeout in the WAF. Instead, the requests were malformed, leading to errors (various 400s) and not being processed correctly.

APPSEC-54879

Changes

  • test_disabled

    • Added a status check for the response to ensure the request is valid and the endpoint is implemented.
    • Excluded Sinatra variants in Ruby, which were causing 404 errors.
  • test_waf_timeout

    • Added a status check for the response to ensure the request is valid and the endpoint is implemented.
    • Excluded Sinatra variants in Ruby, which were causing 404 errors.
    • Modified the payload to:
      • Reduce the URL length and number of headers (the main issue with many frameworks).
      • Increase WAF load by matching more rules.
    • Modify scenario to be able to set python to 1 microsecond (as python waf timeout is configured in milliseconds instead of microseconds)

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes (if something not related to your task is failing, you can ignore it)
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner. We're working on refining the codeowners file quickly.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • If PR title starts with [<language>], double-check that only <language> is impacted by the change
  • No system-tests internal is modified. Otherwise, I have the approval from R&P team
  • CI is green, or failing jobs are not related to this change (and you are 100% sure about this statement)
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added (or removed)?

@jandro996 jandro996 changed the title [JAVA] fix easy wins and check status code to discard false xpass in tests/appsec/test_conf.py Fix easy wins and check status code to discard false xpass in tests/appsec/test_conf.py Jan 21, 2025
@jandro996 jandro996 changed the title Fix easy wins and check status code to discard false xpass in tests/appsec/test_conf.py Fix tests/appsec/test_conf.py Jan 22, 2025
@jandro996 jandro996 marked this pull request as ready for review January 23, 2025 08:46
@jandro996 jandro996 requested review from a team as code owners January 23, 2025 08:46
@cbeauchesne cbeauchesne force-pushed the alejandro.gonzalez/java-easy-wins-w4-5 branch from 8283d31 to 031348c Compare January 23, 2025 15:43
@jandro996 jandro996 merged commit 2ab0b4f into main Jan 24, 2025
@jandro996 jandro996 deleted the alejandro.gonzalez/java-easy-wins-w4-5 branch January 24, 2025 07:52
robertomonteromiguel pushed a commit that referenced this pull request Mar 17, 2025
Co-authored-by: Charles de Beauchesne <charles.de.beauchesne@gmail.com>

Motivation
Fix easy wins in tests/appsec/test_conf.py:

test_disabled
test_waf_timeout
The tests were unreliable as they only checked for the absence of an AppSec event, this is not enough as an unimplemented endpoint or a bad request pass the test

For instance the intention in test_waf_timeout is to verify that there is no event because of a timeout in the WAF. Instead, the requests were malformed, leading to errors (various 400s) and not being processed correctly.

Changes
test_disabled

Added a status check for the response to ensure the request is valid and the endpoint is implemented.
Excluded Sinatra variants in Ruby, which were causing 404 errors.
test_waf_timeout

Added a status check for the response to ensure the request is valid and the endpoint is implemented.
Excluded Sinatra variants in Ruby, which were causing 404 errors.
Modified the payload to:
Reduce the URL length and number of headers (the main issue with many frameworks).
Increase WAF load by matching more rules.
Modify scenario to be able to set python to 1 microsecond (as python waf timeout is configured in milliseconds instead of microseconds)
khanayan123 added a commit that referenced this pull request May 12, 2026
Both upstream blockers landed:

- libdatadog v33.0.0 (2026-05-07) includes #1910 "schedule
  ExtendedHeartbeat on worker start" — the sidecar now actually emits
  the event.
- dd-trace-php#3865 (merged 2026-05-11) bumped the libdatadog
  submodule past v33.0.0 to also include #1962 "include dependencies
  and integrations in app-extended-heartbeat".

#3865 is post-1.19.2, so gate at >=1.20.0 (the next release).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants