Skip to content

Commit

Permalink
Merge pull request #2778 from cybozu-go/fix-upgrade-test
Browse files Browse the repository at this point in the history
test: show additional information when CKE fails to complete
  • Loading branch information
yokaze authored Jan 17, 2025
2 parents 2992587 + 6a41636 commit 478d2cf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dctest/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,14 @@ func testUpgrade() {
g.Expect(err).ShouldNot(HaveOccurred(), "stdout=%s, stderr=%s", stdout, stderr)

if strings.TrimSpace(string(stdout)) != "completed" {
err := errors.New("CKE should complete operations")
// try to get additional information
stdout, stderr, err := execAt(bootServers[0], "ckecli", "history", "-n1")
if err != nil {
err := fmt.Errorf("failed to exec ckecli history. stdout: %s, stderr: %s, err: %w", stdout, stderr, err)
g.Expect(err).ShouldNot(HaveOccurred())
}

err = fmt.Errorf("CKE should complete operations. ckecli history: %s", stdout)
g.Expect(err).ShouldNot(HaveOccurred())
}
}).Should(Succeed())
Expand Down

0 comments on commit 478d2cf

Please sign in to comment.