diff --git a/registry/directory/directory_test.go b/registry/directory/directory_test.go
index 6c85ea08f2bc9f9341db801126c3061ca5995c10..e02cff64a1315e9e931df0e58c0b1b6f04fc7b09 100644
--- a/registry/directory/directory_test.go
+++ b/registry/directory/directory_test.go
@@ -214,6 +214,10 @@ func Test_RefreshUrl(t *testing.T) {
 		&registry.ServiceEvent{Action: remoting.EventTypeAdd, Service: providerUrl2}})
 	time.Sleep(1e9)
 	assert.Len(t, registryDirectory.cacheInvokers, 2)
+	// clear all address
+	mockRegistry.MockEvents([]*registry.ServiceEvent{})
+	time.Sleep(1e9)
+	assert.Len(t, registryDirectory.cacheInvokers, 0)
 }
 
 func normalRegistryDir(noMockEvent ...bool) (*RegistryDirectory, *registry.MockRegistry) {