Skip to content

wip: make CI stable#189

Closed
llamerada-jp wants to merge 1 commit into
mainfrom
stable-ci-1114
Closed

wip: make CI stable#189
llamerada-jp wants to merge 1 commit into
mainfrom
stable-ci-1114

Conversation

@llamerada-jp

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR aims to improve CI stability by adding better error diagnostics to the e2e test suite. The changes focus on capturing and displaying additional debug information when tests fail, particularly around kubectl operations and Job status checks.

Key changes:

  • Enhanced error messages in GetObject function to include stderr output from kubectl commands
  • Added debug output for failed Job assertions to help diagnose CI flakiness
  • Captured Job status information that can be displayed when Eventually assertions fail

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/e2e/multik8s/testutil/util.go Captures stderr from kubectl commands and adds debug logging for Job failures in WriteRandomDataToPV function
test/e2e/multik8s/misc_test.go Adds debug output for Job listing to help diagnose failures when waiting for Jobs to fail

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Eventually(ctx, func(g Gomega) {
job, err := GetJob(cluster, namespace, writeJobName)
g.Expect(err).NotTo(HaveOccurred())
debugJob = job.String() // for debugging

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The job.String() method call is invalid. Kubernetes *batchv1.Job objects don't have a String() method, so this will use Go's default string representation which produces unhelpful output like &{...}.

To get useful debugging information, consider using json.Marshal() to serialize the job object:

debugJobBytes, _ := json.Marshal(job)
debugJob = string(debugJobBytes)
Suggested change
debugJob = job.String() // for debugging
debugJobBytes, _ := json.Marshal(job)
debugJob = string(debugJobBytes) // for debugging

Copilot uses AI. Check for mistakes.
g.Expect(err).NotTo(HaveOccurred())
g.Expect(IsJobConditionTrue(job.Status.Conditions, batchv1.JobComplete)).To(BeFalse())
}).Should(Succeed())
}).Should(Succeed(), "jobs:\n", string(debugJobs))

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Should() method is being called with multiple separate string arguments, but Gomega expects a single concatenated message string. This will not produce the expected failure message format.

Change this to:

}).Should(Succeed(), "jobs:\n"+string(debugJobs))
Suggested change
}).Should(Succeed(), "jobs:\n", string(debugJobs))
}).Should(Succeed(), "jobs:\n"+string(debugJobs))

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants