Repository navigation
test(marketplace): wait for the submit webhook instead of sleeping 200ms - #366
Merged
Merged
Conversation
The submit webhook is dispatched from a detached `tokio::spawn`, so it reaches the wiremock some time after the submit response. The test slept a fixed 200 ms and then asserted — under CI load (right after the long build) the spawn had not landed yet and the suite failed at random with "Submit should send marketplace webhook" (seen on PR #361's CI; the branch touches only secrets.rs). The same race was already fixed in tests/marketplace_admin_review.rs with a bounded poll — this applies the identical pattern here: poll for 5 s, fail only if the webhook truly never arrives. Co-Authored-By: Claude Opus 5 <[email protected]>
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.
What
PR #361's CI failed at random on
marketplace_create_template submit_template_sends_template_submitted_webhook("Submit should send marketplace webhook") — on a branch that touches onlysecrets.rs. The webhook is dispatched from a detachedtokio::spawn(creator.rssend_submit_webhook), so it reaches the wiremock after the submit response; the test slept a fixed 200 ms and then asserted, and under CI load — right after the long build — the spawn had not landed yet.The same race was already fixed in
tests/marketplace_admin_review.rs(wait_for_marketplace_sync_payload— its comment says exactly this: "a fixed 200 ms sleep was too short on a loaded CI runner and failed the suite at random"). This applies the identical bounded-poll pattern to the one test that still had the raw sleep.How
wait_for_submit_webhookpollsreceived_requests()every 50 ms for up to 5 s and returns the/marketplace/syncrequest; the test fails only if the webhook truly never arrives.Tests
marketplace_create_templatesuite: 28 passed (including the hardened one).