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

Add HOMEBREW_TEST_TIMEOUT_SECS env var #18629

Merged
merged 1 commit into from
Oct 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Library/Homebrew/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
require "dev-cmd/test"
require "json/add/exception"

TEST_TIMEOUT_SECONDS = 5 * 60
DEFAULT_TEST_TIMEOUT_SECONDS = 5 * 60

begin
ENV.delete("HOMEBREW_FORBID_PACKAGES_FROM_PATHS")
Expand Down Expand Up @@ -49,7 +49,9 @@
if args.debug? # --debug is interactive
run_test.call
else
Timeout.timeout(TEST_TIMEOUT_SECONDS, &run_test)
# HOMEBREW_TEST_TIMEOUT_SECS is private API and subject to change.
timeout = ENV["HOMEBREW_TEST_TIMEOUT_SECS"]&.to_i || DEFAULT_TEST_TIMEOUT_SECONDS
Timeout.timeout(timeout, &run_test)
end
rescue Exception => e # rubocop:disable Lint/RescueException
error_pipe.puts e.to_json
Expand Down
Loading