Skip to content

Commit

Permalink
Merge #123725
Browse files Browse the repository at this point in the history
123725: roachprod: identify apt failures automatically and mark them as flakes r=vidit-bhat a=vidit-bhat

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

Co-authored-by: Vidit Bhat <vidit.bhat@cockroachlabs.com>
  • Loading branch information
craig[bot] and vidit-bhat committed May 9, 2024
2 parents b8ba30a + 488551c commit fc8482f
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 fc8482f

Please sign in to comment.