Skip to content

Commit

Permalink
update:
Browse files Browse the repository at this point in the history
add agent and mscontext registry failback feature
  • Loading branch information
liangwei3 committed Oct 8, 2023
1 parent fdc9036 commit f2dd189
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,35 +134,35 @@ motan-service:
m := mscontext.GetRegistryStatus()
assert.Equal(len(m), 1)
for _, mm := range m[0] {
assert.Equal(t, mm.Status, motan.NotRegister)
assert.Equal(mm.Status, motan.NotRegister)
}
setRegistryFailSwitcher(true)
mscontext.ServicesAvailable()
m = mscontext.GetRegistryStatus()
assert.Equal(len(m), 1)
for _, mm := range m[0] {
assert.Equal(t, mm.Status, motan.RegisterFailed)
assert.Equal(mm.Status, motan.RegisterFailed)
}
setRegistryFailSwitcher(false)
time.Sleep(registry.DefaultFailbackInterval * time.Millisecond)
m = mscontext.GetRegistryStatus()
assert.Equal(len(m), 1)
for _, mm := range m[0] {
assert.Equal(t, mm.Status, motan.RegisterSuccess)
assert.Equal(mm.Status, motan.RegisterSuccess)
}
setRegistryFailSwitcher(true)
mscontext.ServicesUnavailable()
m = mscontext.GetRegistryStatus()
assert.Equal(len(m), 1)
for _, mm := range m[0] {
assert.Equal(t, mm.Status, motan.UnregisterFailed)
assert.Equal(mm.Status, motan.UnregisterFailed)
}
setRegistryFailSwitcher(false)
time.Sleep(registry.DefaultFailbackInterval * time.Millisecond)
m = mscontext.GetRegistryStatus()
assert.Equal(len(m), 1)
for _, mm := range m[0] {
assert.Equal(t, mm.Status, motan.UnregisterSuccess)
assert.Equal(mm.Status, motan.UnregisterSuccess)
}
}

Expand Down

0 comments on commit f2dd189

Please sign in to comment.