Skip to content

Conversation

@merlimat
Copy link
Contributor

Motivation

Use dynamically allocated ports in unit tests execution to ensure no port conflicts between multiple threads/processes.

@merlimat merlimat added this to the 2.5.0 milestone Oct 28, 2019
@merlimat merlimat self-assigned this Oct 28, 2019
@aahmed-se
Copy link
Contributor

run java8 tests

Copy link
Member

@jiazhai jiazhai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great to have this feature.

@jiazhai
Copy link
Member

jiazhai commented Oct 29, 2019

run java8 tests
run integration tests

Copy link
Contributor

@codelipenghui codelipenghui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@codelipenghui
Copy link
Contributor

run java8 tests

@aahmed-se
Copy link
Contributor

run java8 tests.

@aahmed-se
Copy link
Contributor

run java8 tests

@sijie sijie modified the milestones: 2.5.0, 2.6.0 Nov 25, 2019
@merlimat
Copy link
Contributor Author

merlimat commented Jan 5, 2020

run java8 tests

1 similar comment
@tuteng
Copy link
Member

tuteng commented Jan 5, 2020

run java8 tests

@tuteng
Copy link
Member

tuteng commented Jan 5, 2020

run java8 tests

2 similar comments
@tuteng
Copy link
Member

tuteng commented Jan 5, 2020

run java8 tests

@tuteng
Copy link
Member

tuteng commented Jan 5, 2020

run java8 tests

@tuteng
Copy link
Member

tuteng commented Jan 5, 2020

Unit testing seems to have some problems:

2020-01-05\T\06:21:26.542 [ERROR] testAuthentication(org.apache.pulsar.broker.authentication.ProxySaslAuthenticationTest)  Time elapsed: 33.912 s  <<< FAILURE!
org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.ExecutionException: org.apache.pulsar.client.api.PulsarClientException: Connection already closed
	at org.apache.pulsar.client.api.PulsarClientException.unwrap(PulsarClientException.java:717)
	at org.apache.pulsar.client.impl.ProducerBuilderImpl.create(ProducerBuilderImpl.java:93)
	at org.apache.pulsar.broker.authentication.ProxySaslAuthenticationTest.testAuthentication(ProxySaslAuthenticationTest.java:255)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
	at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:54)
	at org.testng.internal.InvokeMethodRunnable.run(InvokeMethodRunnable.java:44)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

@merlimat merlimat merged commit f141efa into apache:master Jan 5, 2020
@merlimat merlimat deleted the unit-tests-port-0 branch January 5, 2020 20:44
@sijie sijie modified the milestones: 2.6.0, 2.5.1, 2.5.0 Jan 6, 2020
sijie added a commit to sijie/pulsar that referenced this pull request Jan 21, 2020
*Motivation*

A regression was introduced in apache#5486. If websocket service as running as part of
pulsar standalone, the cluster data is set with null service urls. This causes
service url is not set correctly in the pulsar client and an illegal argument exception
("Param serviceUrl must not be blank.") will be thrown.

*Modifications*

1. Pass `null` when constructing the websocket service. So the local cluster data can
   be refreshed when creating pulsar client.
2. Set the cluster data after both broker service and web service started and ports are allocated.

*Test*

Verified locally and need to figure out how to automate this in integration tests
sijie added a commit that referenced this pull request Jan 24, 2020
*Motivation*

Fixes #5997
Fixes #6079

A regression was introduced in #5486. If websocket service as running as part of
pulsar standalone, the cluster data is set with null service urls. This causes
service url is not set correctly in the pulsar client and an illegal argument exception
("Param serviceUrl must not be blank.") will be thrown.

*Modifications*

1. Pass `null` when constructing the websocket service. So the local cluster data can
   be refreshed when creating pulsar client.
2. Set the cluster data after both broker service and web service started and ports are allocated.
tuteng pushed a commit to AmateurEvents/pulsar that referenced this pull request Feb 23, 2020
)

*Motivation*

Fixes apache#5997
Fixes apache#6079

A regression was introduced in apache#5486. If websocket service as running as part of
pulsar standalone, the cluster data is set with null service urls. This causes
service url is not set correctly in the pulsar client and an illegal argument exception
("Param serviceUrl must not be blank.") will be thrown.

*Modifications*

1. Pass `null` when constructing the websocket service. So the local cluster data can
   be refreshed when creating pulsar client.
2. Set the cluster data after both broker service and web service started and ports are allocated.
tuteng pushed a commit to AmateurEvents/pulsar that referenced this pull request Mar 21, 2020
)

*Motivation*

Fixes apache#5997
Fixes apache#6079

A regression was introduced in apache#5486. If websocket service as running as part of
pulsar standalone, the cluster data is set with null service urls. This causes
service url is not set correctly in the pulsar client and an illegal argument exception
("Param serviceUrl must not be blank.") will be thrown.

*Modifications*

1. Pass `null` when constructing the websocket service. So the local cluster data can
   be refreshed when creating pulsar client.
2. Set the cluster data after both broker service and web service started and ports are allocated.

(cherry picked from commit 49a9897)
merlimat pushed a commit to merlimat/pulsar that referenced this pull request Apr 4, 2020
The two failures for this have been fixed by:
- 8df1f9c Do not use timed receive in
  BrokerClientIntegrationTest.testUnsupportedBatchMessageConsumer (apache#5333)
- f141efa Make unit tests to only use dynamically allocated
  ports (apache#5486)
tuteng pushed a commit that referenced this pull request Apr 13, 2020
*Motivation*

Fixes #5997
Fixes #6079

A regression was introduced in #5486. If websocket service as running as part of
pulsar standalone, the cluster data is set with null service urls. This causes
service url is not set correctly in the pulsar client and an illegal argument exception
("Param serviceUrl must not be blank.") will be thrown.

*Modifications*

1. Pass `null` when constructing the websocket service. So the local cluster data can
   be refreshed when creating pulsar client.
2. Set the cluster data after both broker service and web service started and ports are allocated.

(cherry picked from commit 49a9897)
jiazhai pushed a commit to jiazhai/pulsar that referenced this pull request May 18, 2020
)

*Motivation*

Fixes apache#5997
Fixes apache#6079

A regression was introduced in apache#5486. If websocket service as running as part of
pulsar standalone, the cluster data is set with null service urls. This causes
service url is not set correctly in the pulsar client and an illegal argument exception
("Param serviceUrl must not be blank.") will be thrown.

*Modifications*

1. Pass `null` when constructing the websocket service. So the local cluster data can
   be refreshed when creating pulsar client.
2. Set the cluster data after both broker service and web service started and ports are allocated.
(cherry picked from commit 49a9897)
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Aug 24, 2020
* Make unit tests to only use dynamically allocated ports

* Fixed proxy tests

* Fixed zk test utils after merge

* Fixed multi host client test

* Fix for testConcurrentConsumerReceiveWhileReconnect

* Increased timeout on testPulsarSourceLocalRunWithFile

* Fixed newer test to also avoid port manager

* Fixed test race condition with thread starting in PulsarFunctionLocalRunTest

* Fixed ProxyWithAuthorizationNegTest

* Fixed ProxySaslAuthenticationTest
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Aug 24, 2020
)

*Motivation*

Fixes apache#5997
Fixes apache#6079

A regression was introduced in apache#5486. If websocket service as running as part of
pulsar standalone, the cluster data is set with null service urls. This causes
service url is not set correctly in the pulsar client and an illegal argument exception
("Param serviceUrl must not be blank.") will be thrown.

*Modifications*

1. Pass `null` when constructing the websocket service. So the local cluster data can
   be refreshed when creating pulsar client.
2. Set the cluster data after both broker service and web service started and ports are allocated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants