brew update and can still reproduce the problem?brew doctor, fixed all issues and can still reproduce the problem?brew config and brew doctor and included their output with your issue?Run brew tests.
Running brew tests results in an infinite loop and does not end. I narrowed down the problem to svn_spec.rb (which is also a part of utils_spec.rb), and running either brew tests --only=utils/svn or brew tests --only=utils does not end, requiring a manual abort. The output of both commands with --verbose and --debug are shown below.
I believe this may be a Catalina-only problem, possibly related to this issue. I have verified that installing svn via brew with brew install svn solves this brew tests issue (see below).
Command output
-bash-5.0.17- /Users/miccal (31) [> brew tests --only=utils/svn --verbose --debug
Randomized with seed 2803
bundle exec parallel_rspec --nice -- -I /usr/local/Homebrew/Library/Homebrew/test --seed 2803 --color --require spec_helper --format NoSeedProgressFormatter --format ParallelTests::RSpec::RuntimeLogger --out /Users/miccal/Library/Caches/Homebrew/tests/parallel_runtime_rspec.log --tag ~needs_linux -- test/utils/svn_spec.rb
1 processes for 1 specs, ~ 1 specs per process
^C
Took 300 seconds
Tests Failed
Command output
-bash-5.0.17- /Users/miccal (31) [> brew tests --only=utils --verbose --debug
Randomized with seed 27117
bundle exec parallel_rspec --nice -- -I /usr/local/Homebrew/Library/Homebrew/test --seed 27117 --color --require spec_helper --format NoSeedProgressFormatter --format ParallelTests::RSpec::RuntimeLogger --out /Users/miccal/Library/Caches/Homebrew/tests/parallel_runtime_rspec.log --tag ~needs_linux -- test/utils_spec.rb test/utils/tty_spec.rb test/utils/popen_spec.rb test/utils/curl_spec.rb test/utils/fork_spec.rb test/utils/bottles/bottles_spec.rb test/utils/bottles/collector_spec.rb test/utils/bottles/bintray_spec.rb test/utils/git_spec.rb test/utils/analytics_spec.rb test/utils/github_spec.rb test/utils/svn_spec.rb test/utils/shell_spec.rb test/utils/user_spec.rb
8 processes for 14 specs, ~ 1 specs per process
................................*.
Pending: (Failures listed here are expected and do not affect your suite's status)
1) GitHub::get_artifact_url fails to find a nonexistant workflow
# Requires network connection.
# ./test/utils/github_spec.rb:46
2) GitHub::get_artifact_url gets an artifact link
# Requires network connection.
# ./test/utils/github_spec.rb:58
3) GitHub::get_artifact_url fails to find artifacts that don't exist
# Requires network connection.
# ./test/utils/github_spec.rb:52
4) GitHub::search_code queries GitHub code with the passed parameters
# Requires network connection.
# ./test/utils/github_spec.rb:7
5) GitHub::search_issues queries GitHub issues with the passed parameters
# Requires network connection.
# ./test/utils/github_spec.rb:35
Finished in 0.1059 seconds (files took 4.62 seconds to load)
10 examples, 0 failures, 5 pending
................................
.
Finished in 0.16434 seconds (files took 4.64 seconds to load)
10 examples, 0 failures
.
Finished in 0.16043 seconds (files took 4.65 seconds to load)
16 examples, 0 failures
*...
Finished in 0.21058 seconds (files took 4.62 seconds to load)
10 examples, 0 failures
.................*...
Finished in 0.31558 seconds (files took 4.65 seconds to load)
28 examples, 0 failures
.........
Pending: (Failures listed here are expected and do not affect your suite's status)
1) Utils::git_remote_exists? when git is available returns true when git remote exists
# Requires network connection.
# ./test/utils/git_spec.rb:133
Finished in 1.61 seconds (files took 4.61 seconds to load)
17 examples, 0 failures, 1 pending
..
Finished in 1.78 seconds (files took 4.58 seconds to load)
11 examples, 0 failures
^C
102 examples, 0 failures, 6 pendings
Took 300 seconds (1:43)
Tests Failed
brew tests to finish.
brew commands)brew tests --only=utils/svn
brew config and brew doctor commands-bash-5.0.17- /Users/miccal (31) [> brew config HOMEBREW_VERSION: 2.4.0-93-g634c457 ORIGIN: https://github.com/Homebrew/brew HEAD: 634c4571299b5165110eac083dd5c2ae3f84331c Last commit: 16 hours ago Core tap ORIGIN: https://github.com/Homebrew/homebrew-core Core tap HEAD: 4bce00ad7b5a2f4ec589ae55cbeec5c72b58bfd5 Core tap last commit: 49 minutes ago HOMEBREW_PREFIX: /usr/local HOMEBREW_DEVELOPER: set HOMEBREW_EDITOR: /usr/bin/open -e -W HOMEBREW_FORCE_BREWED_CURL: set HOMEBREW_FORCE_BREWED_GIT: set HOMEBREW_FORCE_VENDOR_RUBY: set HOMEBREW_MAKE_JOBS: 8 HOMEBREW_NO_ANALYTICS: set CPU: octa-core 64-bit icelake Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby Clang: 11.0 build 1103 Git: 2.27.0 => /usr/local/opt/git/bin/git Curl: 7.70.0 => /usr/local/opt/curl/bin/curl macOS: 10.15.5-x86_64 CLT: 1103.0.32.62 Xcode: N/A XQuartz: 2.7.11 => /opt/X11
-bash-5.0.17- /Users/miccal (31) [> brew doctor Your system is ready to brew.
@miccal Can you pin down exactly what line is causing this (either we some debugging output or --debug)? Thanks!
@MikeMcQuaid the output of the commands I gave above were both passed with the --verbose and --debug flags, so that is all the output I get unfortunately.
Looking at svn_spec.rb, it is a mystery to me what exactly is causing the hang.
Is there some other way I can provide more information beyond running the command brew tests --only=utils/svn --verbose --debug?
Also, I can confirm that running brew install svn fixes the problem:
-bash-5.0.17- /Users/miccal (30) [> which svn
/usr/local/bin/svn
-bash-5.0.17- /Users/miccal (30) [> brew tests --only=utils/svn --verbose --debug
Randomized with seed 29859
bundle exec parallel_rspec --nice -- -I /usr/local/Homebrew/Library/Homebrew/test --seed 29859 --color --require spec_helper --format NoSeedProgressFormatter --format ParallelTests::RSpec::RuntimeLogger --out /Users/miccal/Library/Caches/Homebrew/tests/parallel_runtime_rspec.log --tag ~needs_linux -- test/utils/svn_spec.rb
1 processes for 1 specs, ~ 1 specs per process
..*.
Pending: (Failures listed here are expected and do not affect your suite's status)
1) Utils#self.svn_remote_exists? when svn is available returns true when remote exists
# Requires network connection.
# ./test/utils/svn_spec.rb:35
Finished in 0.10646 seconds (files took 1.53 seconds to load)
4 examples, 0 failures, 1 pending
4 examples, 0 failures, 1 pending
Took 1 seconds
md5-f0185f0a9d4919a58cfa08b1623ad6e2
-bash-5.0.17- /Users/miccal (30) [> brew remove svn
Uninstalling /usr/local/Cellar/subversion/1.14.0_1... (234 files, 30.6MB)
md5-f0185f0a9d4919a58cfa08b1623ad6e2
-bash-5.0.17- /Users/miccal (30) [> which svn
/usr/bin/svn
md5-f0185f0a9d4919a58cfa08b1623ad6e2
-bash-5.0.17- /Users/miccal (30) [> brew tests --only=utils/svn --verbose --debug
Randomized with seed 37738
bundle exec parallel_rspec --nice -- -I /usr/local/Homebrew/Library/Homebrew/test --seed 37738 --color --require spec_helper --format NoSeedProgressFormatter --format ParallelTests::RSpec::RuntimeLogger --out /Users/miccal/Library/Caches/Homebrew/tests/parallel_runtime_rspec.log --tag ~needs_linux -- test/utils/svn_spec.rb
1 processes for 1 specs, ~ 1 specs per process
^C
Took 300 seconds
Tests Failed
I could reproduce this before I did brew install svn, as could @samford. I haven't yet had a chance to dig into why, and I'm unlikely to get time soon.
This is the same problem I encountered back in April and I came to the same conclusions as @miccal. When we discussed this internally, there was talk that it may be related to the svn shim (i.e., Library/Homebrew/shims/scm/svn) and Catalina not providing svn.
You can reliably reproduce this in a fresh Catalina VM without the subversion formula installed. I don't have the time to investigate this further at the moment but I at least wanted to mention this.
Is there some other way I can provide more information beyond running the command
brew tests --only=utils/svn --verbose --debug?
Yes, you can add a , :focus to the relevant test e.g.:
diff --git a/Library/Homebrew/test/utils/svn_spec.rb b/Library/Homebrew/test/utils/svn_spec.rb
index 04492e9fe..d82944ba8 100644
--- a/Library/Homebrew/test/utils/svn_spec.rb
+++ b/Library/Homebrew/test/utils/svn_spec.rb
@@ -8,7 +8,7 @@ describe Utils do
described_class.clear_svn_version_cache
end
- it "returns svn version if svn available" do
+ it "returns svn version if svn available", :focus do
if File.executable? "/usr/bin/svn"
expect(described_class).to be_svn_available
else
Yeh, this is likely an issue with the SVN shim but we can definitely work around it. I don't have access to a fresh VM.
@MikeMcQuaid I modified svn-spec.rb as per you suggestions, and:
-bash-5.0.17- /Users/miccal (29) [> brew tests --only=utils/svn --verbose --debug
Randomized with seed 26361
bundle exec parallel_rspec --nice -- -I /usr/local/Homebrew/Library/Homebrew/test --seed 26361 --color --require spec_helper --format NoSeedProgressFormatter --format ParallelTests::RSpec::RuntimeLogger --out /Users/miccal/Library/Caches/Homebrew/tests/parallel_runtime_rspec.log --tag ~needs_linux -- test/utils/svn_spec.rb
1 processes for 1 specs, ~ 1 specs per process
^C
RSpec is shutting down and will print the summary report... Interrupt again to force quit.
Took 300 seconds (5:00)
Tests Failed
and I am not sure about this summary report?
@miccal now you have the focus and have it pinned down to a specific test: could you try to add puts around the codebase until you narrow down exactly what line is hanging? Thanks!
@MikeMcQuaid I believe the line that is hanging is:
expect(described_class).to be_svn_available
Adding puts "something" before and after this line outputs the first "something", but not the second.
@miccal Perfect, thanks! What does bash -x $(brew --repo)/Library/Homebrew/shims/scm/svn --version output or do on your machine? What does /usr/bin/svn --version do/output?
@MikeMcQuaid ah, interesting -- both commands hang and require a manual abort. So it seems that svn has been completely removed in a recent version of CLT's on Catalina.
@miccal What does the bash -x ... version output, if anything? What does file /usr/bin/svn output`?
@MikeMcQuaid file /usr/bin/svn outputs what you would expect:
-bash-5.0.17- /Users/miccal (29) [> file /usr/bin/svn
/usr/bin/svn: Mach-O 64-bit executable x86_64
as does:
-bash-5.0.17- /Users/miccal (29) [> test -x /usr/bin/svn && echo true || echo false
true
The bash -x ... output is long, and hangs:
Command output
-bash-5.0.17- /Users/miccal (29) [> bash -x $(brew --repo)/Library/Homebrew/shims/scm/svn --version
Last one I think: output/behaviour of /Library/Developer/CommandLineTools/usr/bin/svn --version? I think we probably need to just never call /usr/bin/svn on Catalina 馃槵
@MikeMcQuaid you have nailed it -- it seems svn is no longer shipped in either Xcode or CLT:
-bash-5.0.17- /Users/miccal (29) [> /Library/Developer/CommandLineTools/usr/bin/svn --version
-bash: /Library/Developer/CommandLineTools/usr/bin/svn: No such file or directory
Also:
-bash-5.0.17- /Users/miccal (29) [> /usr/bin/svnlook
svnlook: error: The subversion command line tools are no longer provided by Xcode.
-bash-5.0.17- /Users/miccal (29) [> /usr/bin/svnversion
svnversion: error: The subversion command line tools are no longer provided by Xcode.
md5-f0185f0a9d4919a58cfa08b1623ad6e2
-bash-5.0.17- /Users/miccal (29) [> man svn
No manual entry for svn
I see it in /Library/Developer/CommandLineTools/usr/bin/svn --version and it works as expected on my machine. I suspect if that's missing then /usr/bin/svn goes 馃挜 on Catalina.
@miccal What's your output of /usr/bin/svnversion --version?
@MikeMcQuaid as above:
-bash-5.0.17- /Users/miccal (29) [> /usr/bin/svnversion --version
svnversion: error: The subversion command line tools are no longer provided by Xcode.
It's a strange issue because I was in the same situation as @miccal in April (where brew tests would hang and I had to have the subversion formula installed to avoid it) but now I'm inexplicably in the same position as @MikeMcQuaid.
A fresh install of Catalina with the Command Line Tools installed is identical to @miccal's output above. For whatever reason, I now have working subversion binaries in /Library/Developer/CommandLineTools/usr/bin/ and /usr/bin and brew tests predictably works _without_ the subversion formula installed.
I did a fresh install of macOS 10.15 when it was released, so somewhere in the last few months my situation changed and I have no idea what led to the difference.
I did a fresh install of macOS 10.15 when it was released, so somewhere in the last few months my situation changed and I have no idea what led to the difference.
Probably installing the CLT and/or a CLT update?
Probably installing the CLT and/or a CLT update?
I imagine it must have been a CLT update because I had the CLT installed back in April.
I uninstalled the Command Line Tools and reinstalled them just now and I'm back in the same boat as @miccal again, for what it's worth. There definitely aren't any Subversion binaries in /Library/Developer/CommandLineTools/usr/bin/ now, which is what the files in /usr/bin were using before.
This issue first appeared (to my knowledge) in homebrew-cask-fonts and at that stage I did not have this issue, but I guess it may be because _sometimes_ I have to force an update of the CLT's via:
sudo rm -r -f /Library/Developer/CommandLineTools; sudo xcode-select --install
@miccal @samford I've opened a PR for this in https://github.com/Homebrew/brew/pull/7814. If you could test it out that'd be wonderful.
@MikeMcQuaid:
-bash-5.0.17- /Users/miccal (29) [> brew tests --only=utils/svn --verbose --debug
Randomized with seed 32898
bundle exec parallel_rspec --nice -- -I /usr/local/Homebrew/Library/Homebrew/test --seed 32898 --color --require spec_helper --format NoSeedProgressFormatter --format ParallelTests::RSpec::RuntimeLogger --out /Users/miccal/Library/Caches/Homebrew/tests/parallel_runtime_rspec.log --tag ~needs_linux -- test/utils/svn_spec.rb
1 processes for 1 specs, ~ 1 specs per process
F..*
Pending: (Failures listed here are expected and do not affect your suite's status)
1) Utils#self.svn_remote_exists? when svn is available returns true when remote exists
# Requires network connection.
# ./test/utils/svn_spec.rb:35
Failures:
1) Utils#self.svn_available? returns svn version if svn available
Failure/Error: expect(described_class).to be_svn_available
expected `Utils.svn_available?` to return true, got false
# ./test/utils/svn_spec.rb:13:in `block (3 levels) in <top (required)>'
# ./test/spec_helper.rb:185:in `block (2 levels) in <top (required)>'
# ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:124:in `block in run'
# ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `loop'
# ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `run'
# ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
# ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:37:in `block (2 levels) in setup'
# ./vendor/bundle/ruby/2.6.0/gems/rspec-wait-0.0.9/lib/rspec/wait.rb:46:in `block (2 levels) in <top (required)>'
Finished in 0.15305 seconds (files took 1.91 seconds to load)
4 examples, 1 failure, 1 pending
Failed examples:
rspec ./test/utils/svn_spec.rb:11 # Utils#self.svn_available? returns svn version if svn available
4 examples, 1 failure, 1 pending
Took 2 seconds
Tests Failed
@miccal So: it's failing but not blocking forever? That seems like progress!
@MikeMcQuaid progress indeed :)
Why not just require brew install svn for Catalina -- that would fix this issue as well?
@MikeMcQuaid progress indeed :)
@miccal Can you try again? Now the shim is working as expected for you I'd fixed the test code accordingly.
Why not just require
brew install svnfor Catalina -- that would fix this issue as well?
That's what the shim does. If it doesn't fix the Cask issue: Cask should be updated to always use the Homebrew shim instead of Subversion directly.
@MikeMcQuaid:
-bash-5.0.17- /Users/miccal (29) [> brew tests --only=utils/svn --verbose --debug
Randomized with seed 64512
bundle exec parallel_rspec --nice -- -I /usr/local/Homebrew/Library/Homebrew/test --seed 64512 --color --require spec_helper --format NoSeedProgressFormatter --format ParallelTests::RSpec::RuntimeLogger --out /Users/miccal/Library/Caches/Homebrew/tests/parallel_runtime_rspec.log --tag ~needs_linux -- test/utils/svn_spec.rb
1 processes for 1 specs, ~ 1 specs per process
...*
Pending: (Failures listed here are expected and do not affect your suite's status)
1) Utils#self.svn_remote_exists? when svn is available returns true when remote exists
# Requires network connection.
# ./test/utils/svn_spec.rb:35
Finished in 0.17601 seconds (files took 1.51 seconds to load)
4 examples, 0 failures, 1 pending
4 examples, 0 failures, 1 pending
Took 1 seconds
@miccal Hooray, fixed! Once I get it working in CI I'll merge. Thanks for all the help 鉂わ笍
@MikeMcQuaid don't thank me, you did all the work! Thank you :)
@MikeMcQuaid may I trouble you with a (probably) dumb question -- what is the _easiest_ way to test an open PR locally?
@miccal Not dumb! hub checkout $URL.
@MikeMcQuaid nice, that _is_ easy, thank you.
Not that it matters much, but just to add that /usr/bin/svn is now gone in Big Sur.
All fixed, thanks again @MikeMcQuaid.
Command output
-bash-5.0.17- /Users/miccal (29) [> brew tests
Randomized with seed 54182
8 processes for 282 specs, ~ 35 specs per process
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................*...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Finished in 1 minute 32.38 seconds (files took 4.37 seconds to load)
376 examples, 0 failures
...............................................................................................................................................................................................................................................*...................
Pending: (Failures listed here are expected and do not affect your suite's status)
1) UnpackStrategy::Subversion #extract
# subversion not installed.
# ./test/unpack_strategy/shared_examples.rb:12
2) UnpackStrategy::Subversion is correctly detected
# subversion not installed.
# ./test/unpack_strategy/shared_examples.rb:6
3) UnpackStrategy::Subversion when the directory name contains an '@' symbol #extract
# subversion not installed.
# ./test/unpack_strategy/shared_examples.rb:12
Finished in 2 minutes 7 seconds (files took 4.4 seconds to load)
311 examples, 0 failures, 3 pending
.......................................................................................................................................................................................................................................................................................................................................................................................................*............
Pending: (Failures listed here are expected and do not affect your suite's status)
1) brew bundle check checks if a Brewfile's dependencies are satisfied
# Requires network connection.
# ./test/cmd/bundle_spec.rb:5
2) brew cask list returns a list of installed Casks
# Requires network connection.
# ./test/cmd/cask_spec.rb:5
3) Bintray::package_exists? detects a package
# Requires network connection.
# ./test/bintray_spec.rb:20
4) Bintray::file_published? detects a published file
# Requires network connection.
# ./test/bintray_spec.rb:8
5) Bintray::file_published? fails on a non-existant file
# Requires network connection.
# ./test/bintray_spec.rb:13
6) Language::Java::overridable_java_home_env returns java_home path without version if version is not specified
# Java not installed.
# ./test/language/java_spec.rb:36
7) Language::Java::java_home returns valid JAVA_HOME if version is specified
# Java not installed.
# ./test/language/java_spec.rb:7
8) Language::Java::java_home returns valid JAVA_HOME if version is not specified
# Java not installed.
# ./test/language/java_spec.rb:12
9) Language::Java::java_home_env returns java_home path without version if version is not specified
# Java not installed.
# ./test/language/java_spec.rb:24
Finished in 2 minutes 28.9 seconds (files took 4.35 seconds to load)
355 examples, 0 failures, 9 pending
...
Pending: (Failures listed here are expected and do not affect your suite's status)
1) Cask::Cmd::Info can run be run with a url twice and returns analytics
# Requires network connection.
# ./test/cask/cmd/info_spec.rb:143
Finished in 2 minutes 31.6 seconds (files took 4.41 seconds to load)
264 examples, 0 failures, 1 pending
.............................................................................................................................................................................................................
Pending: (Failures listed here are expected and do not affect your suite's status)
1) GitHub::search_code queries GitHub code with the passed parameters
# Requires network connection.
# ./test/utils/github_spec.rb:7
2) GitHub::get_artifact_url fails to find artifacts that don't exist
# Requires network connection.
# ./test/utils/github_spec.rb:52
3) GitHub::get_artifact_url gets an artifact link
# Requires network connection.
# ./test/utils/github_spec.rb:58
4) GitHub::get_artifact_url fails to find a nonexistant workflow
# Requires network connection.
# ./test/utils/github_spec.rb:46
5) GitHub::search_issues queries GitHub issues with the passed parameters
# Requires network connection.
# ./test/utils/github_spec.rb:35
6) brew search falls back to a GitHub tap search when no formula is found
# Requires network connection.
# ./test/cmd/search_spec.rb:11
Finished in 2 minutes 51.1 seconds (files took 4.39 seconds to load)
291 examples, 0 failures, 6 pending
...........................................................................................................
Finished in 3 minutes 37.2 seconds (files took 4.43 seconds to load)
291 examples, 0 failures
....................................................................................................................................................................................................................................................................................................................................
Pending: (Failures listed here are expected and do not affect your suite's status)
1) brew services allows controlling services
# Requires network connection.
# ./test/cmd/services_spec.rb:4
2) Utils#self.svn_remote_exists? when svn is available returns true when remote exists
# Requires network connection.
# ./test/utils/svn_spec.rb:35
3) Utils::git_remote_exists? when git is available returns true when git remote exists
# Requires network connection.
# ./test/utils/git_spec.rb:133
Finished in 4 minutes 43.3 seconds (files took 4.48 seconds to load)
613 examples, 0 failures, 3 pending
...........................................................*......................................................................................................
Pending: (Failures listed here are expected and do not affect your suite's status)
1) brew pull fetches a patch from a GitHub commit or pull request and applies it
# Requires network connection.
# ./test/dev-cmd/pull_spec.rb:10
2) Tap #private?
# HOMEBREW_GITHUB_API_TOKEN is required
# ./test/tap_spec.rb:186
Finished in 12 minutes 14 seconds (files took 4.29 seconds to load)
279 examples, 0 failures, 2 pending
2780 examples, 0 failures, 24 pendings
Took 738 seconds (12:18)