Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
16fd3243ab |
2 changed files with 4 additions and 0 deletions
|
@ -239,6 +239,9 @@ func IsAvailable(name string) bool {
|
|||
ctx := storage.GetReadOnlyContext()
|
||||
l := len(fragments)
|
||||
if storage.Get(ctx, append([]byte{prefixRoot}, []byte(fragments[l-1])...)) == nil {
|
||||
if l != 1 {
|
||||
panic("panic should not happen")
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
@ -588,6 +588,7 @@ func TestNNSIsAvailable(t *testing.T) {
|
|||
c := newNNSInvoker(t, false)
|
||||
|
||||
c.Invoke(t, true, "isAvailable", "com")
|
||||
c.InvokeFail(t, "panic should not happen", "isAvailable", "aa.domain.zk")
|
||||
|
||||
refresh, retry, expire, ttl := int64(101), int64(102), int64(103), int64(104)
|
||||
c.Invoke(t, true, "register",
|
||||
|
|
Loading…
Add table
Reference in a new issue