Skip to content

Commit 4a5dc2d

Browse files
test(appsec): narrow to the django flush, per review DD_U55XLN
Reverts the flask app.py timeout change: its 10s already matched the caller's, and cutting it to 5s reduced the flush budget for suites that do assert on test-agent payloads, with no evidence it helped anything. Keeps the django bound, rejustified. It is not the fix for the flake -- gevent 26.8.0 is, via gevent/gevent#2199 -- but an unbounded wait in a fixture teardown holds the job to the suite timeout instead of failing one test, and a lost gevent notification can only park an untimed wait forever. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 2d97853 commit 4a5dc2d

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

tests/appsec/app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,7 @@ def iast_code_injection_vulnerability():
337337

338338
@app.route("/shutdown", methods=["GET"])
339339
def shutdown_view():
340-
# Below the caller's 10s timeout, so the flush gives up before the request does.
341-
tracer.shutdown(timeout=5)
340+
tracer.shutdown(timeout=10)
342341
sys.exit(0)
343342

344343

tests/appsec/integrations/django_tests/django_app/urls.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
def shutdown(request):
1717
# Endpoint used to flush traces to the agent when doing snapshots.
18-
# Bounded: the default waits forever, and under gevent the flush can block the writer's hub.
18+
# Bounded because the default never gives up, and gevent can park an untimed wait forever.
19+
# Stays under the caller's 10s read timeout in appsec_utils.
1920
tracer.shutdown(timeout=5)
2021
return HttpResponse(status=200)
2122

0 commit comments

Comments
 (0)