Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goproxy: avoid subshells #90701

Closed
wants to merge 2 commits into from
Closed

Conversation

carlocab
Copy link
Member

@carlocab carlocab commented Dec 8, 2021

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

Subshells seem to make the test hang indefinitely (e.g. #90350). Let's also
sleep for longer since short sleeps tend to cause trouble in CI.

@carlocab carlocab added the CI-no-bottles Merge without publishing bottles label Dec 8, 2021
@BrewTestBot BrewTestBot added the go Go use is a significant feature of the PR or issue label Dec 8, 2021
@@ -25,8 +25,8 @@ def install
test do
bind_address = "127.0.0.1:#{free_port}"
begin
server = IO.popen("#{bin}/goproxy -proxy=https://goproxy.io -listen=#{bind_address}", err: [:child, :out])
sleep 1
server = IO.popen("#{bin}/goproxy", "-proxy=https://goproxy.io", "-listen=#{bind_address}", err: [:child, :out])
Copy link
Member

@Bo98 Bo98 Dec 8, 2021

Choose a reason for hiding this comment

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

I think this needs to be:

Suggested change
server = IO.popen("#{bin}/goproxy", "-proxy=https://goproxy.io", "-listen=#{bind_address}", err: [:child, :out])
server = IO.popen(["#{bin}/goproxy", "-proxy=https://goproxy.io", "-listen=#{bind_address}"], err: [:child, :out])

because it takes a string mode as a second argument.

Though we should probably do a run without any changes to see if it is reproducible otherwise it's a pointless comparison.

Maybe even remove the Process.kill stuff to try force it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it's reproducible when testing just this formula by itself, but: https://github.com/Homebrew/homebrew-core/actions/runs/1552430219

Copy link
Member

@Bo98 Bo98 Dec 8, 2021

Choose a reason for hiding this comment

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

Temporarily removing the Process.kill and wait stuff might be a way to make it happen. It'll either get auto-killed after 5 minutes or not at all. I'm mostly concerned about the timeout bypass.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, let's try that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it looks like omitting Process.kill and Process.wait causes the test to hang.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, but it still gets caught by the timeout.

This seems to make the test hang indefinitely (e.g. Homebrew#90350). Let's also
sleep for longer since short `sleep`s tend to cause trouble in CI.
@BrewTestBot
Copy link
Member

@carlocab bottle request for goproxy failed.

Also get rid of the `ensure` block to see if we can get this to start
timing out.

This reverts commit 19ccb57.
@github-actions
Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale No recent activity label Dec 30, 2021
@github-actions github-actions bot closed this Jan 6, 2022
@carlocab carlocab deleted the goproxy-test branch September 17, 2022 15:50
@github-actions github-actions bot added the outdated PR was locked due to age label Oct 18, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI-no-bottles Merge without publishing bottles go Go use is a significant feature of the PR or issue outdated PR was locked due to age stale No recent activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants