You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spark.apache.org by Nan Zhu <zh...@gmail.com> on 2014/02/09 15:21:14 UTC

How to write test cases for the functionalities which involves actor communication

Hi, all 

I have a question when trying to write some test cases for the PR

The key functionality in my PR involves actor communication between master and worker, like the worker does something and returns the result to the master via a message, I want to test if the master can do the right thing according to the number of workers existing in the cluster and the return result from the worker, 

Is there any way to test this via some test cases?

Thank you

Best, 

-- 
Nan Zhu


Re: How to write test cases for the functionalities which involves actor communication

Posted by Nan Zhu <zh...@gmail.com>.
Good, thank you very much Patrick 

Best, 

-- 
Nan Zhu



On Sunday, February 9, 2014 at 1:23 PM, Patrick Wendell wrote:

> It's possible to mock out actors... we have a few examples in the code
> base. One his here:
> 
> https://github.com/apache/incubator-spark/blob/master/core/src/test/scala/org/apache/spark/deploy/worker/WorkerWatcherSuite.scala
> 
> On Sun, Feb 9, 2014 at 6:21 AM, Nan Zhu <zhunanmcgill@gmail.com (mailto:zhunanmcgill@gmail.com)> wrote:
> > Hi, all
> > 
> > I have a question when trying to write some test cases for the PR
> > 
> > The key functionality in my PR involves actor communication between master and worker, like the worker does something and returns the result to the master via a message, I want to test if the master can do the right thing according to the number of workers existing in the cluster and the return result from the worker,
> > 
> > Is there any way to test this via some test cases?
> > 
> > Thank you
> > 
> > Best,
> > 
> > --
> > Nan Zhu
> > 
> 
> 
> 



Re: How to write test cases for the functionalities which involves actor communication

Posted by Patrick Wendell <pw...@gmail.com>.
It's possible to mock out actors... we have a few examples in the code
base. One his here:

https://github.com/apache/incubator-spark/blob/master/core/src/test/scala/org/apache/spark/deploy/worker/WorkerWatcherSuite.scala

On Sun, Feb 9, 2014 at 6:21 AM, Nan Zhu <zh...@gmail.com> wrote:
> Hi, all
>
> I have a question when trying to write some test cases for the PR
>
> The key functionality in my PR involves actor communication between master and worker, like the worker does something and returns the result to the master via a message, I want to test if the master can do the right thing according to the number of workers existing in the cluster and the return result from the worker,
>
> Is there any way to test this via some test cases?
>
> Thank you
>
> Best,
>
> --
> Nan Zhu
>