It is. I mean, there are no "real" workers, I'm only simulating it with a fake object with a fake id, and the console.log inside the cluster exit handler prints the same id twice.
On Thu, May 30, 2013 at 2:09 PM, Floby <[email protected]> wrote: > You could try and log the worker.id to see if it's really the same worker > dying. > > On Wednesday, 29 May 2013 12:30:19 UTC+2, Prajwal Manjunath wrote: >> >> I'm trying to test a cluster which forks off three children. When one of >> them dies, the master replaces that worker with a new fork. I'm using Mocha >> with Sinon stubs for testing. >> >> I'm stubbing out the cluster's "fork" method. The first test case which >> checks that it is called thrice (for 3 workers) works fine. >> >> The second test case, which simulates a worker death with >> "cluster.emit('exit')" should cause master to fork once, but Sinon says it >> is getting called twice. Why is this happening? >> > -- > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > > --- > You received this message because you are subscribed to a topic in the > Google Groups "nodejs" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/nodejs/DiezT83XYWg/unsubscribe?hl=en. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
