[GitHub] spark pull request #23041: [SPARK-26069][TESTS]Fix flaky test: RpcIntegratio...

2018-11-16 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/spark/pull/23041


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #23041: [SPARK-26069][TESTS]Fix flaky test: RpcIntegratio...

2018-11-14 Thread zsxwing
Github user zsxwing commented on a diff in the pull request:

https://github.com/apache/spark/pull/23041#discussion_r233734198
  
--- Diff: 
common/network-common/src/test/java/org/apache/spark/network/RpcIntegrationSuite.java
 ---
@@ -371,23 +371,29 @@ private void assertErrorsContain(Set errors, 
Set contains) {
 
   private void assertErrorAndClosed(RpcResult result, String 
expectedError) {
 assertTrue("unexpected success: " + result.successMessages, 
result.successMessages.isEmpty());
-// we expect 1 additional error, which contains *either* "closed" or 
"Connection reset"
+// we expect 1 additional error, which should contain one of the 
follow messages:
+// - "closed"
+// - "Connection reset"
+// - "java.nio.channels.ClosedChannelException"
 Set errors = result.errorMessages;
 assertEquals("Expected 2 errors, got " + errors.size() + "errors: " +
 errors, 2, errors.size());
 
 Set containsAndClosed = Sets.newHashSet(expectedError);
 containsAndClosed.add("closed");
 containsAndClosed.add("Connection reset");
+containsAndClosed.add("java.nio.channels.ClosedChannelException");
 
 Pair, Set> r = checkErrorsContain(errors, 
containsAndClosed);
 
-Set errorsNotFound = r.getRight();
-assertEquals(1, errorsNotFound.size());
-String err = errorsNotFound.iterator().next();
-assertTrue(err.equals("closed") || err.equals("Connection reset"));
+assertTrue("Got a non-empty set " + r.getLeft(), 
r.getLeft().isEmpty());
--- End diff --

Moved this check here so that we can see what's the error that causes the 
test failure.


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #23041: [SPARK-26069][TESTS]Fix flaky test: RpcIntegratio...

2018-11-14 Thread zsxwing
GitHub user zsxwing opened a pull request:

https://github.com/apache/spark/pull/23041

[SPARK-26069][TESTS]Fix flaky test: 
RpcIntegrationSuite.sendRpcWithStreamFailures

## What changes were proposed in this pull request?

The test failure is because `assertErrorAndClosed` misses one possible 
error message: `java.nio.channels.ClosedChannelException`. This happens when 
the second `uploadStream` is called after the channel has been closed. This can 
be reproduced by adding `Thread.sleep(1000)` below this line: 
https://github.com/apache/spark/blob/03306a6df39c9fd6cb581401c13c4dfc6bbd632e/common/network-common/src/test/java/org/apache/spark/network/RpcIntegrationSuite.java#L217

This PR fixes the above issue and also improves the test failure messages 
of `assertErrorAndClosed`.

## How was this patch tested?

Jenkins

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/zsxwing/spark SPARK-26069

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/spark/pull/23041.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 #23041


commit 6bebcb5e004ed4b434c550d26ed1a922d13e0446
Author: Shixiong Zhu 
Date:   2018-11-15T07:16:00Z

fix test




---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org