Merge pull request #18629 from Homebrew/env-config-test-timeout
Add `HOMEBREW_TEST_TIMEOUT_SECS` env var
This commit is contained in:
commit
59d56f84ac
@ -16,7 +16,7 @@ require "cli/parser"
|
|||||||
require "dev-cmd/test"
|
require "dev-cmd/test"
|
||||||
require "json/add/exception"
|
require "json/add/exception"
|
||||||
|
|
||||||
TEST_TIMEOUT_SECONDS = 5 * 60
|
DEFAULT_TEST_TIMEOUT_SECONDS = 5 * 60
|
||||||
|
|
||||||
begin
|
begin
|
||||||
ENV.delete("HOMEBREW_FORBID_PACKAGES_FROM_PATHS")
|
ENV.delete("HOMEBREW_FORBID_PACKAGES_FROM_PATHS")
|
||||||
@ -49,7 +49,9 @@ begin
|
|||||||
if args.debug? # --debug is interactive
|
if args.debug? # --debug is interactive
|
||||||
run_test.call
|
run_test.call
|
||||||
else
|
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
|
end
|
||||||
rescue Exception => e # rubocop:disable Lint/RescueException
|
rescue Exception => e # rubocop:disable Lint/RescueException
|
||||||
error_pipe.puts e.to_json
|
error_pipe.puts e.to_json
|
||||||
|
Loading…
x
Reference in New Issue
Block a user