### Environment

* Dubbo version:  3.0  / master
3.0 github日志：
```
org.opentest4j.AssertionFailedError: expected: <0> but was: <1>
	at org.apache.dubbo.registry.support.FailbackRegistryTest.testRecover(FailbackRegistryTest.java:173)
```
173行代码为：```Assertions.assertEquals(0, mockRegistry.getFailedRegistered().size());```

原因：FailedRegisteredTask和FailedSubscribedTask的doRetry都是先执行doRegister或doSubscribe，再删掉failed task；但MockRegistry在doRegister和doSubscribe就做了latch.countDown()，所以latch.await()返回时机过早导致上述断言失败。
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.dubbo.registry.support;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.apache.dubbo.registry.NotifyListener;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;
import static org.apache.dubbo.registry.Constants.CONSUMER_PROTOCOL;
import static org.apache.dubbo.registry.Constants.REGISTRY_RETRY_PERIOD_KEY;
import static org.junit.jupiter.api.Assertions.assertEquals;