fix node js unit test

prevent infinite loop when child process sending message.