Skip to content

Commit

Permalink
Fix attestation test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
carlocab committed Oct 4, 2024
1 parent 6b63660 commit 7b74bf0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Library/Homebrew/attestation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def self.check_core_attestation(bottle)

sleep_time = 3 ** @attestation_retry_count[bottle]
opoo "Failed to verify attestation. Retrying in #{sleep_time}..."
sleep sleep_time
sleep sleep_time if ENV["HOMEBREW_TESTS"].blank?
@attestation_retry_count[bottle] += 1
retry
end
Expand Down
3 changes: 2 additions & 1 deletion Library/Homebrew/test/attestation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,15 @@
described_class::HOMEBREW_CORE_REPO, "--format", "json"],
env: { "GH_TOKEN" => fake_gh_creds, "GH_HOST" => "github.com" }, secrets: [fake_gh_creds],
print_stderr: false, chdir: HOMEBREW_TEMP)
.once
.exactly(described_class::ATTESTATION_MAX_RETRIES + 1)
.and_raise(described_class::MissingAttestationError)

expect(described_class).to receive(:system_command!)
.with(fake_gh, args: ["attestation", "verify", cached_download, "--repo",
described_class::BACKFILL_REPO, "--format", "json"],
env: { "GH_TOKEN" => fake_gh_creds, "GH_HOST" => "github.com" }, secrets: [fake_gh_creds],
print_stderr: false, chdir: HOMEBREW_TEMP)
.exactly(described_class::ATTESTATION_MAX_RETRIES + 1)
.and_return(fake_result_json_resp_too_new)

expect do
Expand Down

0 comments on commit 7b74bf0

Please sign in to comment.