mocha-parallel-tests icon indicating copy to clipboard operation
mocha-parallel-tests copied to clipboard

reuse processes using a process pool

Open fabiosantoscode opened this issue 5 years ago • 21 comments

fabiosantoscode avatar Oct 15 '18 16:10 fabiosantoscode

Wow, seems like a huge work has been made here! 😮

1999 avatar Oct 15 '18 20:10 1999

I've created my own, much simpler package, that replaces mocha-parallel-tests and is able to reuse child processes: https://www.npmjs.com/package/mochallel

fabiosantoscode avatar Oct 18 '18 16:10 fabiosantoscode

@fabiosantoscode closing this PR as non-active. If you plan to update it feel free to re-open and ping me :)

1999 avatar Oct 31 '18 00:10 1999

Sorry. Can you reopen? I've just pushed a removal of that throw statement.

fabiosantoscode avatar Oct 31 '18 14:10 fabiosantoscode

I've released an alternative to this module that already does process reusing. It's quite fast! Can you match its speed? http://npmjs.com/mochallel

fabiosantoscode avatar Oct 31 '18 14:10 fabiosantoscode

@1999

fabiosantoscode avatar Oct 31 '18 15:10 fabiosantoscode

@fabiosantoscode I noticed your message above. It's great that it's so fast 👍 Can it be used in mocha-parallel-tests somehow or what do you mean by that?

Also it looks like the build is red, so you also need to fix the errors before we can merge this PR.

1999 avatar Oct 31 '18 19:10 1999

You can use the multiprocess-map module that I created to use in mochallel, if you like

fabiosantoscode avatar Nov 02 '18 16:11 fabiosantoscode

I meant it as a challenge :) if you can make a faster mochallel, then everybody wins!

fabiosantoscode avatar Nov 02 '18 16:11 fabiosantoscode

The builds are timing out -- Do you think you know what might be causing it?

fabiosantoscode avatar Nov 02 '18 16:11 fabiosantoscode

Ok, I think I fixed it.

fabiosantoscode avatar Nov 02 '18 19:11 fabiosantoscode

You're almost there: 1 test is failing for node@11.

1999 avatar Nov 02 '18 19:11 1999

Nice job! Can you think of any tests that we might add here and which might be useful for this PR?

1999 avatar Nov 02 '18 20:11 1999

No, I don't think so.

fabiosantoscode avatar Nov 02 '18 20:11 fabiosantoscode

Why not? This PR is a huge improvement to the way mocha-parallel-tests works. For instance if one of the tests is hanging this will stop others from re-using the same process (see #155 for more info). I would like to see all changes covered with tests and here we could for instance check that the process.pid is the same across different files.

1999 avatar Nov 02 '18 20:11 1999

OK, let's do that test.

fabiosantoscode avatar Nov 03 '18 12:11 fabiosantoscode

Done @1999

fabiosantoscode avatar Nov 03 '18 20:11 fabiosantoscode

Done @1999

Sorry, done what?

1999 avatar Nov 03 '18 20:11 1999

Nevermind

fabiosantoscode avatar Nov 03 '18 20:11 fabiosantoscode

Implemented all the ideas for tests. Any more tests you can think of?

fabiosantoscode avatar Nov 09 '18 17:11 fabiosantoscode

I think you can merge now

fabiosantoscode avatar Nov 14 '18 15:11 fabiosantoscode