diff --git a/test/e2e/addon_update.go b/test/e2e/addon_update.go index c4496e10c3d..c953ffe4dc5 100644 --- a/test/e2e/addon_update.go +++ b/test/e2e/addon_update.go @@ -206,7 +206,7 @@ var _ = framework.KubeDescribe("Addon update", func() { var err error sshClient, err = getMasterSSHClient() - Expect(err).NotTo(HaveOccurred()) + Expect(err).NotTo(HaveOccurred(), "Failed to get the master SSH client.") }) AfterEach(func() { @@ -252,7 +252,7 @@ var _ = framework.KubeDescribe("Addon update", func() { for _, p := range remoteFiles { err := writeRemoteFile(sshClient, p.data, temporaryRemotePath, p.fileName, 0644) - Expect(err).NotTo(HaveOccurred()) + Expect(err).NotTo(HaveOccurred(), "Failed to write file %q at remote path %q with ssh client %+v", p.fileName, temporaryRemotePath, sshClient) } // directory on kubernetes-master @@ -261,7 +261,7 @@ var _ = framework.KubeDescribe("Addon update", func() { // cleanup from previous tests _, _, _, err := sshExec(sshClient, fmt.Sprintf("sudo rm -rf %s", destinationDirPrefix)) - Expect(err).NotTo(HaveOccurred()) + Expect(err).NotTo(HaveOccurred(), "Failed to remove remote dir %q with ssh client %+v", destinationDirPrefix, sshClient) defer sshExec(sshClient, fmt.Sprintf("sudo rm -rf %s", destinationDirPrefix)) // ignore result in cleanup sshExecAndVerify(sshClient, fmt.Sprintf("sudo mkdir -p %s", destinationDir)) @@ -352,7 +352,7 @@ func getMasterSSHClient() (*ssh.Client, error) { func sshExecAndVerify(client *ssh.Client, cmd string) { _, _, rc, err := sshExec(client, cmd) - Expect(err).NotTo(HaveOccurred()) + Expect(err).NotTo(HaveOccurred(), "Failed to execute %q with ssh client %+v", cmd, client) Expect(rc).To(Equal(0), "error return code from executing command on the cluster: %s", cmd) } diff --git a/test/e2e/common/configmap.go b/test/e2e/common/configmap.go index fe2d2fdaaca..c93eeeead7a 100644 --- a/test/e2e/common/configmap.go +++ b/test/e2e/common/configmap.go @@ -153,7 +153,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() { configMap.ResourceVersion = "" // to force update configMap.Data["data-1"] = "value-2" _, err = f.Client.ConfigMaps(f.Namespace.Name).Update(configMap) - Expect(err).NotTo(HaveOccurred()) + Expect(err).NotTo(HaveOccurred(), "Failed to update configmap %q in namespace %q", configMap.Name, f.Namespace.Name) By("waiting to observe update in volume") Eventually(pollLogs, podLogTimeout, framework.Poll).Should(ContainSubstring("value-2")) diff --git a/test/e2e/common/downwardapi_volume.go b/test/e2e/common/downwardapi_volume.go index 6d0773e5988..7e763c1f4ab 100644 --- a/test/e2e/common/downwardapi_volume.go +++ b/test/e2e/common/downwardapi_volume.go @@ -127,7 +127,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() { podClient.CreateSync(pod) pod, err := podClient.Get(pod.Name) - Expect(err).NotTo(HaveOccurred()) + Expect(err).NotTo(HaveOccurred(), "Failed to get pod %q", pod.Name) Eventually(func() (string, error) { return framework.GetPodLogs(f.Client, f.Namespace.Name, pod.Name, containerName) diff --git a/test/e2e/common/pods.go b/test/e2e/common/pods.go index c49660b5c70..e04dbb32d8f 100644 --- a/test/e2e/common/pods.go +++ b/test/e2e/common/pods.go @@ -56,7 +56,7 @@ func testHostIP(podClient *framework.PodClient, pod *api.Pod) { t := time.Now() for { p, err := podClient.Get(pod.Name) - Expect(err).NotTo(HaveOccurred()) + Expect(err).NotTo(HaveOccurred(), "Failed to get pod %q", pod.Name) if p.Status.HostIP != "" { framework.Logf("Pod %s has hostIP: %s", p.Name, p.Status.HostIP) break