Closed
Conversation
robbecker-wf
commented
Mar 31, 2026
| 'run', | ||
| 'webdev', | ||
| 'serve', | ||
| '-v', |
dustinlessard-wf
approved these changes
Mar 31, 2026
dustinlessard-wf
requested changes
Mar 31, 2026
dustinlessard-wf
left a comment
There was a problem hiding this comment.
It looks like retries are unbounded and we should probably set a limit of some kind?
Member
Author
|
closing in favor of #67 |
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.
Summary
When running webdev_proxy it runs a webdev serve process under the hood, which in turn can trigger a sometimes lengthy build process. In automated testing scenarios if you run
webdev_proxy servein the background and then immediately try to start using the server you'll get invalid responses until the build is done and the server is actually up and returning valid responses.Under earlier versions of Dart, the build would output a message like
[INFO] Succeeded after Xs ...when the build was done. Scripts in CI could then monitor the output log of the server for this message and then proceed with testing after seeing it.But under Dart 3 (3.11 for example) the output does not include a message like this by default, so those scripts never see the ready message and hang indefinitely.
Changes
This PR runs the internal webdev serve process with verbose mode, which DOES output a message when the build is complete, but it is different. It looks like
[INFO] : Built with build_runner/jit in 45s; wrote 9875 outputs.So, scripts can be updated to look for this new pattern :picard_win: but what about old existing scripts out there looking for the old pattern :ruh_roh: ?
This PR also now tries to detect when the server is ready by sending a request to the server each second until it gets a valid response. 🌶️ Unfortunately, this results in a good bit of noise in the output when first starting up. An explanatory note was added to explain what all this noise is about, but I still don't love it.
and then when the build finally completes and a request succeeds the output looks like
So now scripts can detect either type of ready message to tell when the server is fully ready. As a bonus, it also outputs the URL to the server again at the end of the output so you can click on it.
QA
To test this yourself, just globally activate it from git like so (with Dart 3 and/or Dart 2):
And then give it a rip on your project to see how it goes