tests: add an extra byte of randomness

Two bytes should hopefully be plenty.
This commit is contained in:
Carlo Cabrera 2024-09-25 22:32:51 +08:00
parent e030625eb4
commit e03a9fd0be
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

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