GitHub user zsxwing opened a pull request:
https://github.com/apache/spark/pull/12477
[SPARK-14713][Tests]Fix the flaky test NettyBlockTransferServiceSuite
## What changes were proposed in this pull request?
When there are multiple tests running, "NettyBlockTransferServiceSuite.can
bind to a specific port twice and the second increments" may fail.
E.g., assume there are 2 tests running. Here are the execution order to
reproduce the test failure.
| Execution Order | Test 1 | Test 2 |
| ------------- | ------------- | ------------- |
| 1 | service0 binds to 17634 | |
| 2 | | service0 binds to 17635 (17634 is occupied) |
| 3 | service1 binds to 17636 | |
| 4 | pass test | |
| 5 | service0.close (release 17634) | |
| 6 | | service1 binds to 17634 |
| 7 | | `service1.port should be (service0.port + 1)` fails (17634 !=
17635 + 1) |
Here is an example in Jenkins:
https://amplab.cs.berkeley.edu/jenkins/view/Spark%20QA%20Test/job/spark-master-test-maven-hadoop-2.2/786/testReport/junit/org.apache.spark.network.netty/NettyBlockTransferServiceSuite/can_bind_to_a_specific_port_twice_and_the_second_increments/
This PR makes two changes:
- Use a random port between 17634 and 27634 to reduce the possibility of
port conflicts.
- Make `service1` use `service0.port` to bind to avoid the above race
condition.
## How was this patch tested?
Jenkins unit tests.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zsxwing/spark SPARK-14713
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/12477.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #12477
----
commit 96dce1696ccafaddca2d6d97c32d3c23ce909cec
Author: Shixiong Zhu <[email protected]>
Date: 2016-04-18T18:46:01Z
Fix the flaky test NettyBlockTransferServiceSuite
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]