Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix unit test unstable problem #1355

Merged
merged 1 commit into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void testApplicationInfo() {
public void before() {

httpMockServer = new HttpMockServer();
meshApiClient = new MeshApiClient("http://localhost:7654");
meshApiClient = new MeshApiClient("http://127.0.0.1:7654");

httpMockServer.initSever(7654);
ApplicationInfoResult applicationInfoResult = new ApplicationInfoResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void setUp() {
.setProtocol("mesh")
.setSubscribe(true)
.setRegister(true)
.setAddress("http://localhost:7654");
.setAddress("http://127.0.0.1:7654");

registry = (MeshRegistry) RegistryFactory.getRegistry(registryConfig);
registry.init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void doTest() throws Exception {
referenceBeanC.setApplication(new ApplicationConfig().setAppName("BBB"));
referenceBeanC.setInterfaceId(SampleService.class.getName());
referenceBeanC.setUniqueId("C5");
referenceBeanC.setDirectUrl("localhost:12299");
referenceBeanC.setDirectUrl("127.0.0.1:12299");
referenceBeanC.setTimeout(1000);
MethodConfig methodConfigC = new MethodConfig()
.setName("hello")
Expand All @@ -84,7 +84,7 @@ public void doTest() throws Exception {
referenceBeanD.setApplication(new ApplicationConfig().setAppName("BBB"));
referenceBeanD.setInterfaceId(SampleService.class.getName());
referenceBeanD.setUniqueId("D5");
referenceBeanD.setDirectUrl("localhost:12299?p=1&v=4.0");
referenceBeanD.setDirectUrl("127.0.0.1:12299?p=1&v=4.0");
referenceBeanD.setTimeout(1000);
SampleService sampleServiceD = (SampleService) referenceBeanD.refer();

Expand All @@ -107,7 +107,7 @@ public void doTest() throws Exception {
referenceBeanA.setApplication(new ApplicationConfig().setAppName("AAA"));
referenceBeanA.setUniqueId("B5");
referenceBeanA.setInterfaceId(SampleService.class.getName());
referenceBeanA.setDirectUrl("localhost:12299");
referenceBeanA.setDirectUrl("127.0.0.1:12299");
referenceBeanA.setTimeout(3000);
MethodConfig methodConfigA = new MethodConfig()
.setName("hello")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void doTest() throws Exception {
referenceBeanC.setApplication(new ApplicationConfig().setAppName("BBB"));
referenceBeanC.setInterfaceId(SampleService.class.getName());
referenceBeanC.setUniqueId("C3");
referenceBeanC.setDirectUrl("localhost:12299");
referenceBeanC.setDirectUrl("127.0.0.1:12299");
referenceBeanC.setTimeout(1000);
MethodConfig methodConfigC = new MethodConfig()
.setName("hello")
Expand All @@ -85,7 +85,7 @@ public void doTest() throws Exception {
referenceBeanD.setApplication(new ApplicationConfig().setAppName("BBB"));
referenceBeanD.setInterfaceId(SampleService.class.getName());
referenceBeanD.setUniqueId("D3");
referenceBeanD.setDirectUrl("localhost:12299?p=1&v=4.0");
referenceBeanD.setDirectUrl("127.0.0.1:12299?p=1&v=4.0");
referenceBeanD.setTimeout(1000);
MethodConfig methodConfigD = new MethodConfig()
.setName("hello")
Expand All @@ -112,7 +112,7 @@ public void doTest() throws Exception {
referenceBeanA.setApplication(new ApplicationConfig().setAppName("AAA"));
referenceBeanA.setUniqueId("B3");
referenceBeanA.setInterfaceId(SampleService.class.getName());
referenceBeanA.setDirectUrl("localhost:12299");
referenceBeanA.setDirectUrl("127.0.0.1:12299");
referenceBeanA.setTimeout(3000);
MethodConfig methodConfigA = new MethodConfig()
.setName("hello")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void doTest() throws Exception {
referenceBeanC.setApplication(new ApplicationConfig().setAppName("BBB"));
referenceBeanC.setInterfaceId(SampleService.class.getName());
referenceBeanC.setUniqueId("C2");
referenceBeanC.setDirectUrl("localhost:12299");
referenceBeanC.setDirectUrl("127.0.0.1:12299");
referenceBeanC.setTimeout(1000);
MethodConfig methodConfigC = new MethodConfig()
.setName("hello")
Expand All @@ -79,7 +79,7 @@ public void doTest() throws Exception {
referenceBeanD.setApplication(new ApplicationConfig().setAppName("BBB"));
referenceBeanD.setInterfaceId(SampleService.class.getName());
referenceBeanD.setUniqueId("D2");
referenceBeanD.setDirectUrl("localhost:12299?p=1&v=4.0");
referenceBeanD.setDirectUrl("127.0.0.1:12299?p=1&v=4.0");
referenceBeanD.setTimeout(1000);
MethodConfig methodConfigD = new MethodConfig()
.setName("hello")
Expand All @@ -103,7 +103,7 @@ public void doTest() throws Exception {
referenceBeanA.setApplication(new ApplicationConfig().setAppName("AAA"));
referenceBeanA.setUniqueId("B2");
referenceBeanA.setInterfaceId(SampleService.class.getName());
referenceBeanA.setDirectUrl("localhost:12299");
referenceBeanA.setDirectUrl("127.0.0.1:12299");
referenceBeanA.setTimeout(3000);
MethodConfig methodConfigA = new MethodConfig()
.setName("hello")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void doTest() {
referenceBeanC.setApplication(new ApplicationConfig().setAppName("BBB"));
referenceBeanC.setInterfaceId(SampleService.class.getName());
referenceBeanC.setUniqueId("C4");
referenceBeanC.setDirectUrl("localhost:12299");
referenceBeanC.setDirectUrl("127.0.0.1:12299");
referenceBeanC.setTimeout(1000);
SampleService sampleServiceC = (SampleService) referenceBeanC.refer();

Expand All @@ -74,7 +74,7 @@ void doTest() {
referenceBeanD.setApplication(new ApplicationConfig().setAppName("BBB"));
referenceBeanD.setInterfaceId(SampleService.class.getName());
referenceBeanD.setUniqueId("D4");
referenceBeanD.setDirectUrl("localhost:12299?p=1&v=4.0");
referenceBeanD.setDirectUrl("127.0.0.1:12299?p=1&v=4.0");
referenceBeanD.setTimeout(1000);
SampleService sampleServiceD = (SampleService) referenceBeanD.refer();

Expand All @@ -94,7 +94,7 @@ void doTest() {
referenceBeanA.setApplication(new ApplicationConfig().setAppName("AAA"));
referenceBeanA.setUniqueId("B4");
referenceBeanA.setInterfaceId(SampleService.class.getName());
referenceBeanA.setDirectUrl("localhost:12299");
referenceBeanA.setDirectUrl("127.0.0.1:12299");
referenceBeanA.setTimeout(3000);
MethodConfig methodConfigA = new MethodConfig()
.setName("hello")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void doTest() {
referenceBeanC.setApplication(new ApplicationConfig().setAppName("BBB"));
referenceBeanC.setInterfaceId(SampleService.class.getName());
referenceBeanC.setUniqueId("C1");
referenceBeanC.setDirectUrl("localhost:12299");
referenceBeanC.setDirectUrl("127.0.0.1:12299");
referenceBeanC.setTimeout(1000);
SampleService sampleServiceC = (SampleService) referenceBeanC.refer();

Expand All @@ -71,7 +71,7 @@ void doTest() {
referenceBeanD.setApplication(new ApplicationConfig().setAppName("BBB"));
referenceBeanD.setInterfaceId(SampleService.class.getName());
referenceBeanD.setUniqueId("D1");
referenceBeanD.setDirectUrl("localhost:12299?p=1&v=4.0");
referenceBeanD.setDirectUrl("127.0.0.1:12299?p=1&v=4.0");
referenceBeanD.setTimeout(1000);
SampleService sampleServiceD = (SampleService) referenceBeanD.refer();

Expand All @@ -91,7 +91,7 @@ void doTest() {
referenceBeanA.setApplication(new ApplicationConfig().setAppName("AAA"));
referenceBeanA.setUniqueId("B1");
referenceBeanA.setInterfaceId(SampleService.class.getName());
referenceBeanA.setDirectUrl("localhost:12299");
referenceBeanA.setDirectUrl("127.0.0.1:12299");
referenceBeanA.setTimeout(3000);

SampleService service = (SampleService) referenceBeanA.refer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void doTest() {
referenceBeanC.setApplication(new ApplicationConfig().setAppName("BBB"));
referenceBeanC.setInterfaceId(SampleService.class.getName());
referenceBeanC.setUniqueId("C1");
referenceBeanC.setDirectUrl("localhost:12299");
referenceBeanC.setDirectUrl("127.0.0.1:12299");
referenceBeanC.setSerialization("protobuf");
referenceBeanC.setTimeout(1000);
SampleService sampleServiceC = (SampleService) referenceBeanC.refer();
Expand All @@ -75,7 +75,7 @@ void doTest() {
referenceBeanD.setApplication(new ApplicationConfig().setAppName("BBB"));
referenceBeanD.setInterfaceId(SampleService.class.getName());
referenceBeanD.setUniqueId("D1");
referenceBeanD.setDirectUrl("localhost:12299?p=1&v=4.0");
referenceBeanD.setDirectUrl("127.0.0.1:12299?p=1&v=4.0");
referenceBeanD.setSerialization("protobuf");
referenceBeanD.setTimeout(1000);
SampleService sampleServiceD = (SampleService) referenceBeanD.refer();
Expand All @@ -96,7 +96,7 @@ void doTest() {
referenceBeanA.setApplication(new ApplicationConfig().setAppName("AAA"));
referenceBeanA.setUniqueId("B1");
referenceBeanA.setInterfaceId(SampleService.class.getName());
referenceBeanA.setDirectUrl("localhost:12299");
referenceBeanA.setDirectUrl("127.0.0.1:12299");
referenceBeanA.setSerialization("protobuf");
referenceBeanA.setTimeout(3000);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void testInvoke() throws InterruptedException {
ConsumerConfig<TripleHessianInterface> consumerConfig = new ConsumerConfig<TripleHessianInterface>();
consumerConfig.setInterfaceId(TripleHessianInterface.class.getName())
.setProtocol(RpcConstants.PROTOCOL_TYPE_TRIPLE)
.setDirectUrl("localhost:" + port)
.setDirectUrl("127.0.0.1:" + port)
.setRegister(false)
.setApplication(clientApp);

Expand Down Expand Up @@ -152,7 +152,7 @@ public void testInvokeWithUniqueId() throws InterruptedException {
ConsumerConfig<TripleHessianInterface> consumerConfig = new ConsumerConfig<TripleHessianInterface>();
consumerConfig.setInterfaceId(TripleHessianInterface.class.getName())
.setProtocol(RpcConstants.PROTOCOL_TYPE_TRIPLE)
.setDirectUrl("localhost:" + port)
.setDirectUrl("127.0.0.1:" + port)
.setUniqueId(uniqueId)
.setRegister(false)
.setApplication(clientApp);
Expand Down Expand Up @@ -183,7 +183,7 @@ public void testInvokeWithUniqueId() throws InterruptedException {
consumerConfig = new ConsumerConfig<TripleHessianInterface>();
consumerConfig.setInterfaceId(TripleHessianInterface.class.getName())
.setProtocol(RpcConstants.PROTOCOL_TYPE_TRIPLE)
.setDirectUrl("localhost:" + port)
.setDirectUrl("127.0.0.1:" + port)
.setRegister(false)
.setApplication(clientApp);

Expand Down Expand Up @@ -313,7 +313,7 @@ public void testExposeTwoUniqueId() {
ConsumerConfig<TripleHessianInterface> consumerConfig = new ConsumerConfig<>();
consumerConfig.setInterfaceId(TripleHessianInterface.class.getName())
.setProtocol(RpcConstants.PROTOCOL_TYPE_TRIPLE)
.setDirectUrl("localhost:" + port)
.setDirectUrl("127.0.0.1:" + port)
.setUniqueId(uniqueId)
.setRegister(false)
.setApplication(clientApp);
Expand All @@ -324,7 +324,7 @@ public void testExposeTwoUniqueId() {
ConsumerConfig<TripleHessianInterface> consumerConfig2 = new ConsumerConfig<>();
consumerConfig2.setInterfaceId(TripleHessianInterface.class.getName())
.setProtocol(RpcConstants.PROTOCOL_TYPE_TRIPLE)
.setDirectUrl("localhost:" + port)
.setDirectUrl("127.0.0.1:" + port)
.setUniqueId(uniqueId2)
.setRegister(false)
.setApplication(clientApp);
Expand Down Expand Up @@ -362,7 +362,7 @@ public void testTripleRpcInvokeContext() {
ConsumerConfig<TripleHessianInterface> consumerConfig = new ConsumerConfig<TripleHessianInterface>();
consumerConfig.setInterfaceId(TripleHessianInterface.class.getName())
.setProtocol(RpcConstants.PROTOCOL_TYPE_TRIPLE)
.setDirectUrl("localhost:" + port)
.setDirectUrl("127.0.0.1:" + port)
.setTimeout(300000)
.setRegister(false)
.setApplication(clientApp);
Expand Down