diff --git a/tests/framework/e2e/etcd_process.go b/tests/framework/e2e/etcd_process.go index 86a0d975f756..dec2330ecd3b 100644 --- a/tests/framework/e2e/etcd_process.go +++ b/tests/framework/e2e/etcd_process.go @@ -17,6 +17,7 @@ package e2e import ( "bytes" "context" + "errors" "fmt" "io" "net/http" @@ -387,18 +388,11 @@ type multiLogsExpect struct { } func (m *multiLogsExpect) ExpectWithContext(ctx context.Context, s string) (string, error) { - var lastErr error - for _, log := range m.procLogs { - r, err := log.ExpectWithContext(ctx, s) - if err != nil { - lastErr = err - continue - } - - return r, nil + if len(m.procLogs) == 0 { + return "", errors.New("no process log found") } - return "", lastErr + return m.procLogs[len(m.procLogs)-1].ExpectWithContext(ctx, s) } func (m *multiLogsExpect) Lines() []string {