Skip to content
Snippets Groups Projects
Commit ef124d86 authored by Xin.Zh's avatar Xin.Zh Committed by GitHub
Browse files

Merge pull request #363 from amudong/develop

fix:nacos client_test bug
parents 2ca6f051 1f9af227
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ package nacos
import (
"strings"
"testing"
"time"
)
import (
......@@ -25,7 +26,13 @@ func Test_newNacosClient(t *testing.T) {
assert.NoError(t, err)
c.wg.Add(1)
go HandleClientRestart(c)
c.client.Close()
go func() {
// c.client.Close() and <-c.client.Done() have order requirements.
// If c.client.Close() is called first.It is possible that "go HandleClientRestart(c)"
// sets c.client to nil before calling c.client.Done().
time.Sleep(time.Second)
c.client.Close()
}()
<-c.client.Done()
c.Destroy()
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment