Skip to content

Commit

Permalink
add cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
shivaji-kharse committed Mar 12, 2024
1 parent 22bddc1 commit 361eec0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions dgraphtest/local_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,18 +338,19 @@ func (c *LocalCluster) Start() error {
// sometimes health check doesn't work due to unmapped ports. We dont know why this happens,
// but checking it 4 times before failing the test.
for i := 0; i < 4; i++ {
c.Cleanup(false)
if err := c.init(); err != nil {
c.Cleanup(true)
return err
}

if err = startAll(); err == nil {
return nil
}
log.Printf("[WARNING] Saw the error :%v, trying again", err)
if err1 := c.Stop(); err1 != nil {
log.Printf("[WARNING] error while stopping :%v", err)
}
c.Cleanup(false)
if err := c.init(); err != nil {
c.Cleanup(true)
return err
}
}

return err
Expand Down

0 comments on commit 361eec0

Please sign in to comment.