Merge pull request #18413 from Homebrew/more-random-temp-dir

tests: add an extra byte of randomness
This commit is contained in:
Mike McQuaid 2024-09-25 16:01:49 +01:00 committed by GitHub
commit 2f2ca82035
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,7 +19,7 @@ end.freeze
# Use a shorter HOMEBREW_TEMP path so Sequoia doesn't error out as often on long paths (> 104 bytes).
# Use the minimal amount of randomness to avoid collisions while allowing parallel tests.
require "securerandom"
random_hex = SecureRandom.hex(1)
random_hex = SecureRandom.hex(2)
HOMEBREW_TEMP = Pathname("#{homebrew_temp}/brewtests#{random_hex}".squeeze("/")).freeze
HOMEBREW_TEMP.mkpath