testserver: fix URL file polling code#181
Merged
RaduBerinde merged 1 commit intomasterfrom May 19, 2025
Merged
Conversation
Member
srosenberg
reviewed
May 18, 2025
testserver/testserver.go
Outdated
| } else if !os.IsNotExist(err) { | ||
| return fmt.Errorf("unexpected error while reading listening URL file: %w", err) | ||
| } | ||
| if err != nil && !os.IsNotExist(err) { |
Member
There was a problem hiding this comment.
Nit: left conjunct is a tautology, it can be dropped.
Member
Author
There was a problem hiding this comment.
It's not, when data is empty. I'll refactor a bit so it's less subtle.
TFTR!
Member
Author
There was a problem hiding this comment.
Cleaned it up a little.
srosenberg
approved these changes
May 18, 2025
The asynchronous code that polls for the URL file leads to very opaque failures. This change reworks this code to waiting synchronously, so that we know the server is started before we return. In cases of failure, we now get more useful errors.
da8b339 to
fa0e787
Compare
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.
The asynchronous code that polls for the URL file leads to very opaque failures. This change reworks this code to waiting synchronously, so that we know the server is started before we return. In cases of failure, we now get more useful errors.