Skip to content

Commit 43cb148

Browse files
authored
Do not fail tests when interrupted connection during upgrade (#4533)
Older agent versions don't properly handle an interrupted connection during the upgrade. So, we need to handle it in tests. The check was introduced in 4ad7824 however it checked a wrong string, it was supposed to check the output of the command not the actual error string.
1 parent 0cc5fa0 commit 43cb148

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

testing/upgradetest/upgrader.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ func PerformUpgrade(
330330
// we can determine this state by the EOF error coming from the server.
331331
// If the server is just unavailable/not running, we should not succeed.
332332
// Starting with version 8.13.2, this is handled by the upgrade command itself.
333-
isConnectionInterrupted := strings.Contains(err.Error(), "Unavailable") && strings.Contains(err.Error(), "EOF")
333+
outputString := string(upgradeOutput)
334+
isConnectionInterrupted := strings.Contains(outputString, "Unavailable") && strings.Contains(outputString, "EOF")
334335
if !isConnectionInterrupted {
335336
return fmt.Errorf("failed to start agent upgrade to version %q: %w\n%s", endVersionInfo.Binary.Version, err, upgradeOutput)
336337
}

0 commit comments

Comments
 (0)