Skip to content

Commit

Permalink
Merge pull request #8690 from jmolmo/issue_8669
Browse files Browse the repository at this point in the history
ceph: fix probable cause of intermittent fails in the manager test
  • Loading branch information
travisn committed Sep 20, 2021
2 parents a357db9 + 5c75139 commit 8755759
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions tests/integration/ceph_mgr_test.go
Expand Up @@ -177,8 +177,10 @@ func (s *CephMgrSuite) waitForOrchestrationModule() {

// Get status information
bytes := []byte(output)
logBytesInfo(bytes)

var status orchStatus
err := json.Unmarshal(bytes, &status)
err := json.Unmarshal(bytes[:len(output)], &status)
if err != nil {
logger.Error("Error getting ceph orch status")
continue
Expand Down Expand Up @@ -222,6 +224,14 @@ func (s *CephMgrSuite) TestStatus() {
assert.Equal(s.T(), status, "Backend: rook\nAvailable: Yes")
}

func logBytesInfo(bytesSlice []byte){
logger.Infof("---- bytes slice info ---")
logger.Infof("bytes: %v\n", bytesSlice)
logger.Infof("length: %d\n", len(bytesSlice))
logger.Infof("string: -->%s<--\n", string(bytesSlice))
logger.Infof("-------------------------")
}

func (s *CephMgrSuite) TestHostLs() {
logger.Info("Testing .... <ceph orch host ls>")

Expand All @@ -231,9 +241,10 @@ func (s *CephMgrSuite) TestHostLs() {
logger.Infof("output = %s", output)

hosts := []byte(output)
var hostsList []host
logBytesInfo(hosts)

err = json.Unmarshal(hosts, &hostsList)
var hostsList []host
err = json.Unmarshal(hosts[:len(output)], &hostsList)
if err != nil {
assert.Nil(s.T(), err)
}
Expand Down Expand Up @@ -265,9 +276,10 @@ func (s *CephMgrSuite) TestServiceLs() {
logger.Infof("output = %s", output)

services := []byte(output)
var servicesList []service
logBytesInfo(services)

err = json.Unmarshal(services, &servicesList)
var servicesList []service
err = json.Unmarshal(services[:len(output)], &servicesList)
assert.Nil(s.T(), err)

labelFilter := ""
Expand Down

0 comments on commit 8755759

Please sign in to comment.