Skip to content

Commit

Permalink
fix neco-reboter_test.go to use strimgs.TrimSpace
Browse files Browse the repository at this point in the history
  • Loading branch information
YZ775 committed Sep 12, 2024
1 parent f20f197 commit 661ec7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dctest/neco-rebooter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func testNecoRebooter() {
if len(stdout) == 0 {
return errors.New("no leader")
}
leaderNodeBefore = strings.TrimSuffix(string(stdout), "\n")
leaderNodeBefore = strings.TrimSpace(string(stdout))
return nil
}).Should(Succeed())

Expand All @@ -40,7 +40,7 @@ func testNecoRebooter() {
if len(stdout) == 0 {
return errors.New("no leader")
}
leaderNodeAfter := strings.TrimSuffix(string(stdout), "\n")
leaderNodeAfter := strings.TrimSpace(string(stdout))
if leaderNodeAfter == leaderNodeBefore {
return errors.New("leader is not changed")
}
Expand Down
4 changes: 2 additions & 2 deletions dctest/reboot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func testNecoRebooterRebootGracefully() {
Expect(err).NotTo(HaveOccurred(), "stdout: %s, stderr: %s", stdout, stderr)

By(fmt.Sprintf("adding %s nodes to reboot-list", racks[0]))
// [:4] is number of "rack"
// racks[0][:4] represents the rack number
execSafeAt(bootServers[0], "yes", "|", "neco", "rebooter", "reboot-worker", "--rack="+racks[0][4:])

By("enable rebooting")
Expand All @@ -363,7 +363,7 @@ func testNecoRebooterRebootGracefully() {
}).Should(Succeed())

By(fmt.Sprintf("adding %s nodes to reboot-list", racks[1]))
// [:4] is number of "rack"
// racks[0][:4] represents the rack number
execSafeAt(bootServers[0], "yes", "|", "neco", "rebooter", "reboot-worker", "--rack="+racks[1][4:])

By(fmt.Sprintf("waiting for skipping %s and moving to %s", racks[0], racks[1]))
Expand Down

0 comments on commit 661ec7e

Please sign in to comment.