test(cloudflare): Unflake integration test#20208
Open
Conversation
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Core
Deps
Other
Bug Fixes 🐛
Internal Changes 🔧Deps
Other
🤖 This preview updates automatically when you update the PR. |
nicohrubec
reviewed
Apr 10, 2026
| // This is needed because wrangler dev may not guarantee waitUntil completion | ||
| // the same way production Cloudflare does. Without this delay, the last | ||
| // envelope's HTTP request may not complete before the test moves on. | ||
| const delay = () => new Promise(resolve => setTimeout(resolve, 50)); |
Member
There was a problem hiding this comment.
m: can we solve this differently, specifically is there some event that we could await before moving onto the next request instead of adding a timeout? this might already help but I am worried that this will not fully resolve the flakiness
Member
|
any chance this resolves #20209? |
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.
There was one flaky test, which got me a little deeper into the
runner.tslogic. This test was only passing when it was running / finishing first. With theshuffleflag it was consistently failing, this is why this is added in this PR as well.Furthermore a random port will be created for each runner by setting
--port 0, this just makes sure that when runningwrangler devin another tab, while running the tests, the local development has the default:8787port.