-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-4295][External]Fix exception in SparkSinkSuite #3177
Conversation
Can one of the admins verify this patch? |
Can you clarify how the tests pass if an exception is thrown? does that also need a fix? |
Exception throws before each test case although all test cases are passed . That's not the expect behavior i think. In order to avoid exception in each test case, set different channel name in each test case. |
@maji2014 Correct, I verified this error after adding a log4j properties in the As part of this patch, could you add the missing @harishreedharan you should take a look at this. |
@@ -159,6 +159,7 @@ class SparkSinkSuite extends FunSuite { | |||
channelContext.put("transactionCapacity", 1000.toString) | |||
channelContext.put("keep-alive", 0.toString) | |||
channelContext.putAll(overrides) | |||
channel.setName(getClass.getDeclaredMethods.toString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this crazy name? Since this is being only used in this class, this string will always be the same. In that case, we can simple do "Channel", isnt it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can simply use a randomly generated string as the channel name, so the InstanceAlreadyExistsException would not pop up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As i have no good idea about how to get a random string name, such as how to get each test case name. In getClass.getDeclaredMethods.toString, we can get different string like[Ljava.lang.reflect.Method;@5f3ef269.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, that's nifty, but hugely non-intuitive. Rather, please use scala.util.Random.nextString(10)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please address the other comment about adding log4j.properties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's ok
Jenkins, this is ok to test |
Test build #23212 has started for PR 3177 at commit
|
Test build #23212 has finished for PR 3177 at commit
|
Test PASSed. |
@maji2014 Thanks for this fix. Merging this. |
Handle exception in SparkSinkSuite, please refer to [SPARK-4295] Author: maji2014 <[email protected]> Closes #3177 from maji2014/spark-4295 and squashes the following commits: 312620a [maji2014] change a new statement for spark-4295 24c3d21 [maji2014] add log4j.properties for SparkSinkSuite and spark-4295 c807bf6 [maji2014] Fix exception in SparkSinkSuite (cherry picked from commit f8811a5) Signed-off-by: Tathagata Das <[email protected]>
Handle exception in SparkSinkSuite, please refer to [SPARK-4295] Author: maji2014 <[email protected]> Closes #3177 from maji2014/spark-4295 and squashes the following commits: 312620a [maji2014] change a new statement for spark-4295 24c3d21 [maji2014] add log4j.properties for SparkSinkSuite and spark-4295 c807bf6 [maji2014] Fix exception in SparkSinkSuite (cherry picked from commit f8811a5) Signed-off-by: Tathagata Das <[email protected]>
Handle exception in SparkSinkSuite, please refer to [SPARK-4295]