32
32
import org .junit .jupiter .api .AfterEach ;
33
33
import org .junit .jupiter .api .Assertions ;
34
34
import org .junit .jupiter .api .BeforeEach ;
35
- import org .junit .jupiter .api .Disabled ;
36
35
import org .junit .jupiter .api .Test ;
37
36
38
37
import java .net .URI ;
44
43
45
44
import static org .apache .dubbo .common .constants .CommonConstants .CONSUMER_SIDE ;
46
45
import static org .apache .dubbo .common .constants .CommonConstants .PROVIDER_SIDE ;
46
+ import static org .apache .dubbo .metadata .support .Constants .SYNC_REPORT_KEY ;
47
47
48
48
/**
49
49
* Unit test for etcd metadata report
@@ -63,7 +63,7 @@ public void setUp() {
63
63
etcdCluster .start ();
64
64
etcdClientForTest = Client .builder ().endpoints (etcdCluster .getClientEndpoints ()).build ();
65
65
List <URI > clientEndPoints = etcdCluster .getClientEndpoints ();
66
- this .registryUrl = URL .valueOf ("etcd://" + clientEndPoints .get (0 ).getHost () + ":" + clientEndPoints .get (0 ).getPort ());
66
+ this .registryUrl = URL .valueOf ("etcd://" + clientEndPoints .get (0 ).getHost () + ":" + clientEndPoints .get (0 ).getPort ()). addParameter ( SYNC_REPORT_KEY , true ) ;
67
67
etcdMetadataReportFactory = new EtcdMetadataReportFactory ();
68
68
this .etcdMetadataReport = (EtcdMetadataReport ) etcdMetadataReportFactory .createMetadataReport (registryUrl );
69
69
}
@@ -74,7 +74,6 @@ public void tearDown() throws Exception {
74
74
}
75
75
76
76
@ Test
77
- @ Disabled ("Disabled because https://github.com/apache/dubbo/issues/4185" )
78
77
public void testStoreProvider () throws Exception {
79
78
String version = "1.0.0" ;
80
79
String group = null ;
@@ -120,7 +119,6 @@ private MetadataIdentifier storeProvider(EtcdMetadataReport etcdMetadataReport,
120
119
ServiceDefinitionBuilder .buildFullDefinition (interfaceClass , url .getParameters ());
121
120
122
121
etcdMetadataReport .storeProviderMetadata (providerMetadataIdentifier , fullServiceDefinition );
123
- Thread .sleep (1000 );
124
122
return providerMetadataIdentifier ;
125
123
}
126
124
@@ -131,7 +129,6 @@ private MetadataIdentifier storeConsumer(EtcdMetadataReport etcdMetadataReport,
131
129
Map <String , String > tmp = new HashMap <>();
132
130
tmp .put ("paramConsumerTest" , "etcdConsumer" );
133
131
etcdMetadataReport .storeConsumerMetadata (consumerIdentifier , tmp );
134
- Thread .sleep (1000 );
135
132
return consumerIdentifier ;
136
133
}
137
134
}
0 commit comments