-
-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Here is an attempt by me to build worker-based tests with the current implementation, modulo the current issue with async tests:
cobblers-children/faceoff@main...workers
That's a lot of heavy lifting. Just way too much for anyone else to want to do (I'm willing because I only have to do it once and lots of people will hopefully get to use it as-is).
I think it would be much simpler if bench-node ran all of the new Suite and suite.add() functions checking whether we are in a Worker thread or not and making different decisions when it is.
Including having suite.run() wait for a message and then only running specific tests as the result of that call.
This will avoid all problems with tests trying to keep any state outside of the function under test, (example of a test that broke:
cobblers-children/faceoff@main...workers#diff-0d458569bd1c86b86a54927f40fa1fc49fa9862cc6b0a10adbfcd780e9286327
)
and drastically simplify the setup and teardown workflow, which is just gonna be harsh to deal with. Things might get a little weird for large test suites (like prom-client) but it's already pretty weird as things stand.