Stabilize flaky notification-webhook integration test#15043
Open
Maffooch wants to merge 1 commit into
Open
Conversation
The Selenium test pinged the public httpbin.org on webhook save (a 10s synchronous validation request), making it fail intermittently in CI. Route the webhook URL to the local go-httpbin mock (already used by the unit tests) by wiring webhook.endpoint into the integration-test stack and the workflow's explicit service startup. Also replace the tautological "or Webhook" assertions with explicit alert waits and specific success-message checks so real failures actually fail. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
valentijnscholten
approved these changes
Jun 18, 2026
This was referenced Jun 18, 2026
Jino-T
approved these changes
Jun 18, 2026
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.
Problem
tests/notification_webhook_test.pyhas been failing on most PRs but passing on rerun. Root cause:test_add_notification_webhookset the webhook URL to the publichttps://httpbin.org/post, and DefectDojo synchronously pings the webhook URL on save (AddNotificationWebhooksView.process_form→_test_webhooks_notification→requests.request(..., timeout=10s)). Every run blocked up to 10s on a rate-limited, intermittently-unreachable external service.The near-tautological assertions (
... or is_text_present_on_page("Webhook")) also masked real failures, so only transient network hiccups ever surfaced.Changes
docker-compose.override.integration_tests.yml— add thewebhook.endpointgo-httpbin mock (same pinned image already used by the unit-test override)..github/workflows/integration-tests.yml— addwebhook.endpointto the explicitdocker compose up --no-depsservice list (--no-depsignoresdepends_on).tests/notification_webhook_test.pyhttp://webhook.endpoint:8080/post(local mock, no external egress); edit test resets the URL too so its save-time ping succeeds.wait_for_alert()helper instead of relying on the 1s implicit wait.Verification
The stronger assertions are now load-bearing: pointing the URL at a dead host correctly fails the test (the old version passed).
🤖 Generated with Claude Code