Skip to content

Commit

Permalink
roachprod: identify apt failures automatically and mark them as flakes
Browse files Browse the repository at this point in the history
Previously, we used to get roachtest failures when the
Ubuntu mirrors were down for a period of time.

This PR identifies these apt failures and marks them as a flake.

Epic: none
Fixes: #103316

Release note: None
  • Loading branch information
vidit-bhat committed May 8, 2024
1 parent e90d15c commit 488551c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/roachprod/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const (
unclassifiedExitCode = 1

sshProblemCause = "ssh_problem"
aptProblemCause = "apt_problem"
)

const (
Expand Down Expand Up @@ -104,6 +105,11 @@ func NewSSHError(err error) TransientError {
return TransientFailure(err, sshProblemCause)
}

// AptError returns a transient error for apt-related issues.
func AptError(err error) TransientError {
return TransientFailure(err, aptProblemCause)
}

func IsSSHError(err error) bool {
var transientErr TransientError
if errors.As(err, &transientErr) {
Expand Down Expand Up @@ -149,6 +155,9 @@ func ClassifyCmdError(err error) Error {
if exitCode == 255 {
return NewSSHError(err)
}
if exitCode == 100 {
return AptError(err)
}
return Cmd{err}
}

Expand Down

0 comments on commit 488551c

Please sign in to comment.