Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: consolidate various randomPort() implementations#12362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
johnstcn merged 2 commits intomainfromcj/dry-testutil-random-port
Feb 29, 2024

Conversation

johnstcn
Copy link
Member

Consolidates our existingrandomPort() implementations totestutil.RandomPort(NoListen)?.

@johnstcnjohnstcn self-assigned thisFeb 29, 2024
@johnstcnjohnstcn changed the titlechore: DRY up various randomPort() implementationschore: refactor and DRY various randomPort() implementationsFeb 29, 2024
@johnstcnjohnstcn changed the titlechore: refactor and DRY various randomPort() implementationschore: consolidate various randomPort() implementationsFeb 29, 2024
@johnstcnjohnstcnenabled auto-merge (squash)February 29, 2024 12:37
Copy link
Member

@mtojekmtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

just a digression on naming, otherwise 👍

@@ -838,7 +837,7 @@ func TestAgent_TCPRemoteForwarding(t *testing.T) {
var ll net.Listener
var err error
for {
randomPort =pickRandomPort()
randomPort =testutil.RandomPortNoListen(t)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

nit:testutil.FreePort?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This one isn't guaranteed to be free and relies on pure randommess.
Regarding the other implementation, I just picked the existing name.
We can rename later if need be. 👍

@johnstcnjohnstcn merged commiteba8cd7 intomainFeb 29, 2024
@johnstcnjohnstcn deleted the cj/dry-testutil-random-port branchFebruary 29, 2024 12:51
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsFeb 29, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@mtojekmtojekmtojek approved these changes

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@johnstcn@mafredri@mtojek

[8]ページ先頭

©2009-2025 Movatter.jp