Skip to content

Commit

Permalink
Stabilize EtcdMetadataReportTest (apache#5088)
Browse files Browse the repository at this point in the history
  • Loading branch information
biyuhao authored and CrazyHZM committed Sep 20, 2019
1 parent 87631aa commit 79c6166
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.net.URI;
Expand All @@ -44,6 +43,7 @@

import static org.apache.dubbo.common.constants.CommonConstants.CONSUMER_SIDE;
import static org.apache.dubbo.common.constants.CommonConstants.PROVIDER_SIDE;
import static org.apache.dubbo.metadata.support.Constants.SYNC_REPORT_KEY;

/**
* Unit test for etcd metadata report
Expand All @@ -63,7 +63,7 @@ public void setUp() {
etcdCluster.start();
etcdClientForTest = Client.builder().endpoints(etcdCluster.getClientEndpoints()).build();
List<URI> clientEndPoints = etcdCluster.getClientEndpoints();
this.registryUrl = URL.valueOf("etcd://" + clientEndPoints.get(0).getHost() + ":" + clientEndPoints.get(0).getPort());
this.registryUrl = URL.valueOf("etcd://" + clientEndPoints.get(0).getHost() + ":" + clientEndPoints.get(0).getPort()).addParameter(SYNC_REPORT_KEY, true);
etcdMetadataReportFactory = new EtcdMetadataReportFactory();
this.etcdMetadataReport = (EtcdMetadataReport) etcdMetadataReportFactory.createMetadataReport(registryUrl);
}
Expand All @@ -74,7 +74,6 @@ public void tearDown() throws Exception {
}

@Test
@Disabled("Disabled because https://github.com/apache/dubbo/issues/4185")
public void testStoreProvider() throws Exception {
String version = "1.0.0";
String group = null;
Expand Down Expand Up @@ -120,7 +119,6 @@ private MetadataIdentifier storeProvider(EtcdMetadataReport etcdMetadataReport,
ServiceDefinitionBuilder.buildFullDefinition(interfaceClass, url.getParameters());

etcdMetadataReport.storeProviderMetadata(providerMetadataIdentifier, fullServiceDefinition);
Thread.sleep(1000);
return providerMetadataIdentifier;
}

Expand All @@ -131,7 +129,6 @@ private MetadataIdentifier storeConsumer(EtcdMetadataReport etcdMetadataReport,
Map<String, String> tmp = new HashMap<>();
tmp.put("paramConsumerTest", "etcdConsumer");
etcdMetadataReport.storeConsumerMetadata(consumerIdentifier, tmp);
Thread.sleep(1000);
return consumerIdentifier;
}
}

0 comments on commit 79c6166

Please sign in to comment.