mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #34295 from macb/e2e/annotate_errors
Automatic merge from submit-queue annotate some addtional errors in e2e tests <!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md 2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md 3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes --> **What this PR does / why we need it**: Adds some additional context to e2e test failures. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, #<issue_number>, ...)` format, will close that issue when PR gets merged)*: some work toward #34059 **Special notes for your reviewer**: I didn't want to go through all of the offending cases so I picked off a few files and addressed those. **Release note**: <!-- Steps to write your release note: 1. Use the release-note-* labels to set the release note state (if you have access) 2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. --> ```release-note NONE ```
This commit is contained in:
commit
16da3824ec
@ -206,7 +206,7 @@ var _ = framework.KubeDescribe("Addon update", func() {
|
|||||||
|
|
||||||
var err error
|
var err error
|
||||||
sshClient, err = getMasterSSHClient()
|
sshClient, err = getMasterSSHClient()
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred(), "Failed to get the master SSH client.")
|
||||||
})
|
})
|
||||||
|
|
||||||
AfterEach(func() {
|
AfterEach(func() {
|
||||||
@ -252,7 +252,7 @@ var _ = framework.KubeDescribe("Addon update", func() {
|
|||||||
|
|
||||||
for _, p := range remoteFiles {
|
for _, p := range remoteFiles {
|
||||||
err := writeRemoteFile(sshClient, p.data, temporaryRemotePath, p.fileName, 0644)
|
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
|
// directory on kubernetes-master
|
||||||
@ -261,7 +261,7 @@ var _ = framework.KubeDescribe("Addon update", func() {
|
|||||||
|
|
||||||
// cleanup from previous tests
|
// cleanup from previous tests
|
||||||
_, _, _, err := sshExec(sshClient, fmt.Sprintf("sudo rm -rf %s", destinationDirPrefix))
|
_, _, _, 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
|
defer sshExec(sshClient, fmt.Sprintf("sudo rm -rf %s", destinationDirPrefix)) // ignore result in cleanup
|
||||||
sshExecAndVerify(sshClient, fmt.Sprintf("sudo mkdir -p %s", destinationDir))
|
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) {
|
func sshExecAndVerify(client *ssh.Client, cmd string) {
|
||||||
_, _, rc, err := sshExec(client, cmd)
|
_, _, 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)
|
Expect(rc).To(Equal(0), "error return code from executing command on the cluster: %s", cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
|
|||||||
configMap.ResourceVersion = "" // to force update
|
configMap.ResourceVersion = "" // to force update
|
||||||
configMap.Data["data-1"] = "value-2"
|
configMap.Data["data-1"] = "value-2"
|
||||||
_, err = f.Client.ConfigMaps(f.Namespace.Name).Update(configMap)
|
_, 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")
|
By("waiting to observe update in volume")
|
||||||
Eventually(pollLogs, podLogTimeout, framework.Poll).Should(ContainSubstring("value-2"))
|
Eventually(pollLogs, podLogTimeout, framework.Poll).Should(ContainSubstring("value-2"))
|
||||||
|
@ -127,7 +127,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() {
|
|||||||
podClient.CreateSync(pod)
|
podClient.CreateSync(pod)
|
||||||
|
|
||||||
pod, err := podClient.Get(pod.Name)
|
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) {
|
Eventually(func() (string, error) {
|
||||||
return framework.GetPodLogs(f.Client, f.Namespace.Name, pod.Name, containerName)
|
return framework.GetPodLogs(f.Client, f.Namespace.Name, pod.Name, containerName)
|
||||||
|
@ -56,7 +56,7 @@ func testHostIP(podClient *framework.PodClient, pod *api.Pod) {
|
|||||||
t := time.Now()
|
t := time.Now()
|
||||||
for {
|
for {
|
||||||
p, err := podClient.Get(pod.Name)
|
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 != "" {
|
if p.Status.HostIP != "" {
|
||||||
framework.Logf("Pod %s has hostIP: %s", p.Name, p.Status.HostIP)
|
framework.Logf("Pod %s has hostIP: %s", p.Name, p.Status.HostIP)
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user