From 488551c67edb918a26a4b2be0ecf656fbc6e3974 Mon Sep 17 00:00:00 2001 From: Vidit Bhat Date: Tue, 7 May 2024 14:56:34 +0530 Subject: [PATCH] roachprod: identify apt failures automatically and mark them as flakes 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 --- pkg/roachprod/errors/errors.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/roachprod/errors/errors.go b/pkg/roachprod/errors/errors.go index 401b602d9fb9..2a3d9e623876 100644 --- a/pkg/roachprod/errors/errors.go +++ b/pkg/roachprod/errors/errors.go @@ -33,6 +33,7 @@ const ( unclassifiedExitCode = 1 sshProblemCause = "ssh_problem" + aptProblemCause = "apt_problem" ) const ( @@ -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) { @@ -149,6 +155,9 @@ func ClassifyCmdError(err error) Error { if exitCode == 255 { return NewSSHError(err) } + if exitCode == 100 { + return AptError(err) + } return Cmd{err} }